samanvitha21 commited on
Commit
3387330
·
verified ·
1 Parent(s): 712ec47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
2
  import datetime
3
  import requests
4
  import pytz
@@ -39,11 +39,10 @@ def get_weather(city: str) -> str:
39
  final_answer = FinalAnswerTool()
40
 
41
  # ------------------- MODEL CONFIG -------------------
42
- model = HfApiModel(
43
  max_tokens=2096,
44
  temperature=0.5,
45
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct', # You can change if overloaded
46
- custom_role_conversions=None,
47
  )
48
 
49
  # ------------------- IMAGE GENERATION TOOL -------------------
@@ -57,7 +56,7 @@ with open("prompts.yaml", 'r') as stream:
57
  agent = CodeAgent(
58
  model=model,
59
  tools=[
60
- final_answer,
61
  DuckDuckGoSearchTool(), # optional: search
62
  image_generation_tool,
63
  get_weather,
@@ -75,3 +74,4 @@ agent = CodeAgent(
75
 
76
  # ------------------- LAUNCH APP -------------------
77
  GradioUI(agent).launch()
 
 
1
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, HFModel, load_tool, tool
2
  import datetime
3
  import requests
4
  import pytz
 
39
  final_answer = FinalAnswerTool()
40
 
41
  # ------------------- MODEL CONFIG -------------------
42
+ model = HFModel(
43
  max_tokens=2096,
44
  temperature=0.5,
45
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
 
46
  )
47
 
48
  # ------------------- IMAGE GENERATION TOOL -------------------
 
56
  agent = CodeAgent(
57
  model=model,
58
  tools=[
59
+ final_answer,
60
  DuckDuckGoSearchTool(), # optional: search
61
  image_generation_tool,
62
  get_weather,
 
74
 
75
  # ------------------- LAUNCH APP -------------------
76
  GradioUI(agent).launch()
77
+