Open
Description
Good evening,
I'm trying to use SHAP for my graduation thesis with various LLM, as Falcon, Mistral and GPT 4 and Llama, and i'm trying to follow the instruction with GPT-2 as in documentation but it's not possible to apply it to GPT-4, is there any solution to obtain Shapley Values with GPT-4 using SHAP?
I put an example of my code
import json
from langchain.chat_models import ChatOpenAI
import shap
with open('path/to/apikey.json', 'r') as file_json:
dati_json = json.load(file_json)
openai.api_key = dati_json['OPENAI_API_KEY']
chat = ChatOpenAI(temperature=0.0, openai_api_key =dati_json["OPENAI_API_KEY"] )
review_template = ["I enjoy walking with my cute dog"]
explainer = shap.Explainer(chat)
shap_values = explainer(t)
Thanks in advance!