Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,12 +58,10 @@ tools = [audio_tool, image_tool, wiki_tool]
|
|
58 |
# )
|
59 |
# super().__init__(model=model, tools=tools, system_prompt=SYSTEM_PROMPT)
|
60 |
|
61 |
-
|
62 |
-
|
63 |
class MyAgent(CodeAgent):
|
64 |
def __init__(self):
|
65 |
model = HfApiModel(
|
66 |
-
|
67 |
api_key=os.getenv("HF_API_TOKEN")
|
68 |
)
|
69 |
super().__init__(model=model, tools=tools)
|
@@ -71,12 +69,13 @@ class MyAgent(CodeAgent):
|
|
71 |
def __call__(self, question_dict):
|
72 |
question = question_dict.get("question", "")
|
73 |
full_prompt = SYSTEM_PROMPT + "\n\n" + question
|
74 |
-
# Pass a new dict with the full prompt, adjust key if your agent expects differently
|
75 |
new_input = question_dict.copy()
|
76 |
new_input["question"] = full_prompt
|
77 |
return super().__call__(new_input)
|
78 |
|
79 |
|
|
|
|
|
80 |
# Evaluation + Submission function
|
81 |
def run_and_submit_all(profile: gr.OAuthProfile | None):
|
82 |
space_id = os.getenv("SPACE_ID")
|
|
|
58 |
# )
|
59 |
# super().__init__(model=model, tools=tools, system_prompt=SYSTEM_PROMPT)
|
60 |
|
|
|
|
|
61 |
class MyAgent(CodeAgent):
|
62 |
def __init__(self):
|
63 |
model = HfApiModel(
|
64 |
+
model="mistralai/Mixtral-8x7B-Instruct-v0.1", # pass model ID, not full URL
|
65 |
api_key=os.getenv("HF_API_TOKEN")
|
66 |
)
|
67 |
super().__init__(model=model, tools=tools)
|
|
|
69 |
def __call__(self, question_dict):
|
70 |
question = question_dict.get("question", "")
|
71 |
full_prompt = SYSTEM_PROMPT + "\n\n" + question
|
|
|
72 |
new_input = question_dict.copy()
|
73 |
new_input["question"] = full_prompt
|
74 |
return super().__call__(new_input)
|
75 |
|
76 |
|
77 |
+
|
78 |
+
|
79 |
# Evaluation + Submission function
|
80 |
def run_and_submit_all(profile: gr.OAuthProfile | None):
|
81 |
space_id = os.getenv("SPACE_ID")
|