mgerlitz commited on
Commit
58f4161
·
verified ·
1 Parent(s): 6743f7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
9
 
@@ -46,13 +46,13 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
46
 
47
  final_answer = FinalAnswerTool()
48
 
49
- model = HfApiModel(
50
- max_tokens=2096,
51
- temperature=0.5,
52
- model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
53
- #model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
54
- custom_role_conversions=None,
55
- )
56
 
57
  with open("prompts.yaml", 'r') as stream:
58
  prompt_templates = yaml.safe_load(stream)
@@ -70,7 +70,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
70
  prompt_templates=prompt_templates
71
  )
72
 
73
- model = HfApiModel()
74
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
75
 
76
  #agent = BasicAgent()
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, load_tool, tool
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
9
 
 
46
 
47
  final_answer = FinalAnswerTool()
48
 
49
+ #model = HfApiModel(
50
+ # max_tokens=2096,
51
+ # temperature=0.5,
52
+ # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
53
+ # #model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
54
+ # custom_role_conversions=None,
55
+ #)
56
 
57
  with open("prompts.yaml", 'r') as stream:
58
  prompt_templates = yaml.safe_load(stream)
 
70
  prompt_templates=prompt_templates
71
  )
72
 
73
+ model = InferenceClientModel()
74
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
75
 
76
  #agent = BasicAgent()