mgerlitz commited on
Commit
6d164eb
·
verified ·
1 Parent(s): 9ee4c14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -26
app.py CHANGED
@@ -44,32 +44,14 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
44
  # 1. Instantiate Agent ( modify this part to create your agent)
45
  try:
46
 
47
- #final_answer = FinalAnswerTool()
48
-
49
-
50
-
51
- model = HfApiModel(
52
- max_tokens=2096,
53
- temperature=0.5,
54
- model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
55
- #model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
56
- custom_role_conversions=None,
57
- )
58
-
59
- with open("prompts.yaml", 'r') as stream:
60
- prompt_templates = yaml.safe_load(stream)
61
-
62
- # We're creating our CodeAgent
63
- agent = CodeAgent(
64
- model=model,
65
- tools=[ DuckDuckGoSearchTool(), VisitWebpageTool()],
66
- max_steps=6,
67
- verbosity_level=1,
68
- grammar=None,
69
- planning_interval=None,
70
- name=None,
71
- description=None,
72
- prompt_templates=prompt_templates
73
  )
74
 
75
  #agent = BasicAgent()
@@ -113,6 +95,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
113
  continue
114
  try:
115
  #submitted_answer = agent(question_text)
 
116
  submitted_answer = agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")
117
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
118
  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
  #agent = BasicAgent()
 
95
  continue
96
  try:
97
  #submitted_answer = agent(question_text)
98
+ print("Asking question ...")
99
  submitted_answer = agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")
100
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
101
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})