evgeniypark commited on
Commit
f3dfd5b
·
verified ·
1 Parent(s): d6b5584

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -4,7 +4,8 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  import re
7
- from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel
 
8
 
9
  # (Keep Constants as is)
10
  # --- Constants ---
@@ -14,7 +15,16 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
14
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
15
  class BasicAgent:
16
  def __init__(self):
17
- self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=InferenceClientModel())
 
 
 
 
 
 
 
 
 
18
  def __call__(self, question: str) -> str:
19
  print(f"Agent received question (first 50 chars): {question[:50]}...")
20
  agent_answer = self.agent.run(f"There is GAIA test level 1 <question>{question}</question>. Provide the most possible answer inside <answer></answer> tag")
 
4
  import inspect
5
  import pandas as pd
6
  import re
7
+ from smolagents import CodeAgent, VisitWebpageTool, InferenceClientModel
8
+ from smolagents import OpenAIServerModel
9
 
10
  # (Keep Constants as is)
11
  # --- Constants ---
 
15
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
16
  class BasicAgent:
17
  def __init__(self):
18
+ self.model = OpenAIServerModel("gpt-4o", max_tokens=8096)
19
+ self.agent = CodeAgent(
20
+ model=multimodal_model,
21
+ verbosity_level=0,
22
+ tools=[VisitWebpageTool()],
23
+ max_steps=10,
24
+ name="multimodal_agent",
25
+ description="Multimodal LLM can proceed images",
26
+ )
27
+
28
  def __call__(self, question: str) -> str:
29
  print(f"Agent received question (first 50 chars): {question[:50]}...")
30
  agent_answer = self.agent.run(f"There is GAIA test level 1 <question>{question}</question>. Provide the most possible answer inside <answer></answer> tag")