Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,22 +44,22 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 44 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 45 |
try:
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
model_id = "meta-llama/Llama-3.3-70B-Instruct"
|
| 58 |
|
| 59 |
#model = InferenceClientModel(model_id=model_id, token="<YOUR_HUGGINGFACEHUB_API_TOKEN>") # You can choose to not pass any model_id to InferenceClientModel to use a default model
|
| 60 |
-
model = InferenceClientModel()
|
| 61 |
# you can also specify a particular provider e.g. provider="together" or provider="sambanova"
|
| 62 |
-
agent = CodeAgent(tools=[], model=model, add_base_tools=True)
|
| 63 |
|
| 64 |
#agent = BasicAgent()
|
| 65 |
except Exception as e:
|
|
@@ -103,7 +103,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 103 |
try:
|
| 104 |
#submitted_answer = agent(question_text)
|
| 105 |
print("Asking question ...")
|
| 106 |
-
submitted_answer = agent.run(
|
| 107 |
print("Asked question ...")
|
| 108 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 109 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
|
|
|
| 44 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 45 |
try:
|
| 46 |
|
| 47 |
+
agent = CodeAgent(
|
| 48 |
+
tools=[
|
| 49 |
+
DuckDuckGoSearchTool(),
|
| 50 |
+
VisitWebpageTool()
|
| 51 |
+
],
|
| 52 |
+
model=HfApiModel(),
|
| 53 |
+
max_steps=10,
|
| 54 |
+
verbosity_level=2
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
#model_id = "meta-llama/Llama-3.3-70B-Instruct"
|
| 58 |
|
| 59 |
#model = InferenceClientModel(model_id=model_id, token="<YOUR_HUGGINGFACEHUB_API_TOKEN>") # You can choose to not pass any model_id to InferenceClientModel to use a default model
|
| 60 |
+
#model = InferenceClientModel()
|
| 61 |
# you can also specify a particular provider e.g. provider="together" or provider="sambanova"
|
| 62 |
+
#agent = CodeAgent(tools=[], model=model, add_base_tools=True)
|
| 63 |
|
| 64 |
#agent = BasicAgent()
|
| 65 |
except Exception as e:
|
|
|
|
| 103 |
try:
|
| 104 |
#submitted_answer = agent(question_text)
|
| 105 |
print("Asking question ...")
|
| 106 |
+
submitted_answer = agent.run(question_text)
|
| 107 |
print("Asked question ...")
|
| 108 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 109 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|