WaelDahech commited on
Commit
5986116
·
1 Parent(s): e1843cb

test static answer

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -20,7 +20,7 @@ import yaml
20
 
21
  MyAgent = CodeAgent(
22
  model= InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct"),
23
- tools=[*tools_list], ## add your tools here (don't remove final answer)
24
  max_steps=6,
25
  verbosity_level=1,
26
  grammar=None,
@@ -29,6 +29,16 @@ MyAgent = CodeAgent(
29
  description=None,
30
  prompt_templates=None
31
  )
 
 
 
 
 
 
 
 
 
 
32
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
33
  class BasicAgent:
34
  def __init__(self):
@@ -60,7 +70,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
60
 
61
  # 1. Instantiate Agent ( modify this part to create your agent)
62
  try:
63
- agent = MyAgent
64
  except Exception as e:
65
  print(f"Error instantiating agent: {e}")
66
  return f"Error initializing agent: {e}", None
 
20
 
21
  MyAgent = CodeAgent(
22
  model= InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct"),
23
+ tools=[]
24
  max_steps=6,
25
  verbosity_level=1,
26
  grammar=None,
 
29
  description=None,
30
  prompt_templates=None
31
  )
32
+
33
+ class BasicAgent:
34
+ def __init__(self):
35
+ print("BasicAgent initialized.")
36
+ def __call__(self, question: str) -> str:
37
+ print(f"Agent received question (first 50 chars): {question[:50]}...")
38
+ fixed_answer = "This is a default answer."
39
+ print(f"Agent returning fixed answer: {fixed_answer}")
40
+ return fixed_answer
41
+
42
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
43
  class BasicAgent:
44
  def __init__(self):
 
70
 
71
  # 1. Instantiate Agent ( modify this part to create your agent)
72
  try:
73
+ agent = BasicAgent()
74
  except Exception as e:
75
  print(f"Error instantiating agent: {e}")
76
  return f"Error initializing agent: {e}", None