WaelDahech commited on
Commit
60a3f40
·
1 Parent(s): ae99a00

add openai req

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -88,6 +88,19 @@ OpenAIAgent = CodeAgent(
88
  )
89
  # you can allow extra imports if needed:
90
  # additional_authorized_imports=["requests", "bs4"],
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  print("agent loaded")
93
 
@@ -114,7 +127,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
114
 
115
  # 1. Instantiate Agent ( modify this part to create your agent)
116
  try:
117
- agent = OpenAIAgent
118
  except Exception as e:
119
  print(f"Error instantiating agent: {e}")
120
  return f"Error initializing agent: {e}", None
 
88
  )
89
  # you can allow extra imports if needed:
90
  # additional_authorized_imports=["requests", "bs4"],
91
+ model_id = "Qwen/Qwen2.5-Coder-32B-Instruct"
92
+
93
+ my_agent = CodeAgent(
94
+ model= InferenceClientModel(model_id=model_id),
95
+ tools=[final_answer, wikipedia_search], ## add your tools here (don't remove final answer)
96
+ max_steps=6,
97
+ verbosity_level=1,
98
+ grammar=None,
99
+ planning_interval=None,
100
+ name=None,
101
+ description=None,
102
+ prompt_templates=prompt_templates
103
+ )
104
 
105
  print("agent loaded")
106
 
 
127
 
128
  # 1. Instantiate Agent ( modify this part to create your agent)
129
  try:
130
+ agent = my_agent
131
  except Exception as e:
132
  print(f"Error instantiating agent: {e}")
133
  return f"Error initializing agent: {e}", None