Synnove commited on
Commit
3230253
·
verified ·
1 Parent(s): dbc02a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -36,14 +36,14 @@ class BasicAgent:
36
 
37
  class BasicCodeAgent:
38
  def __init__(self):
39
- #model = InferenceClientModel() #Cause of
40
 
41
- model = HfApiModel(
42
- max_tokens=2096,
43
- temperature=0.5,
44
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
45
- custom_role_conversions=None,
46
- )
47
 
48
  self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
49
  print("BasicCodeAgent initialized.")
@@ -51,9 +51,9 @@ class BasicCodeAgent:
51
  def __call__(self, question: str) -> str:
52
  print(f"BasicCodeAgent received question (first 50 chars): {question[:50]}...")
53
  fixed_answer = "This is a default answer."
54
- #answer = self.agent.run(question)
55
  print(f"BasicCodeAgent returning fixed answer: {fixed_answer}")
56
- return fixed_answer
57
 
58
  def run_and_submit_all( profile: gr.OAuthProfile | None):
59
  """
 
36
 
37
  class BasicCodeAgent:
38
  def __init__(self):
39
+ model = InferenceClientModel() #Cause of
40
 
41
+ # model = HfApiModel(
42
+ # max_tokens=2096,
43
+ # temperature=0.5,
44
+ # model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
45
+ # custom_role_conversions=None,
46
+ # )
47
 
48
  self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
49
  print("BasicCodeAgent initialized.")
 
51
  def __call__(self, question: str) -> str:
52
  print(f"BasicCodeAgent received question (first 50 chars): {question[:50]}...")
53
  fixed_answer = "This is a default answer."
54
+ answer = self.agent.run(question)
55
  print(f"BasicCodeAgent returning fixed answer: {fixed_answer}")
56
+ return answer
57
 
58
  def run_and_submit_all( profile: gr.OAuthProfile | None):
59
  """