hectorgarciacun commited on
Commit
07c10bf
·
verified ·
1 Parent(s): 98499e0

Update app.py

Browse files

usar InferenceClientModel en lugar de HfApiModel (deprecated ver1.14.0)

Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
 
3
  #from smolagents import CodeAgent,DuckDuckGoSearchTool, InferenceClientModel, load_tool,tool
4
 
@@ -44,22 +44,22 @@ final_answer = FinalAnswerTool()
44
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
45
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
46
 
47
- model = HfApiModel(
48
- max_tokens=2096,
49
- temperature=0.5,
50
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
51
- custom_role_conversions=None,
52
- )
53
-
54
-
55
- #model = InferenceClientModel(
56
  #max_tokens=2096,
 
57
  #model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
58
  #custom_role_conversions=None,
59
- #temperature=0.5,
60
  #)
61
 
62
 
 
 
 
 
 
 
 
 
63
 
64
 
65
  # Import tool from Hub
 
1
+ from smolagents import CodeAgent,DuckDuckGoSearchTool, FinalAnswerTool, HfApiModel, InferenceClientModel, load_tool,tool
2
 
3
  #from smolagents import CodeAgent,DuckDuckGoSearchTool, InferenceClientModel, load_tool,tool
4
 
 
44
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
45
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
46
 
47
+ #model = HfApiModel(
 
 
 
 
 
 
 
 
48
  #max_tokens=2096,
49
+ #temperature=0.5,
50
  #model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
51
  #custom_role_conversions=None,
 
52
  #)
53
 
54
 
55
+ model = InferenceClientModel(
56
+ max_tokens=2096,
57
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
58
+ custom_role_conversions=None,
59
+ temperature=0.5,
60
+ )
61
+
62
+
63
 
64
 
65
  # Import tool from Hub