Ap98 commited on
Commit
ecc3d3c
·
verified ·
1 Parent(s): 14e08d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -8,12 +8,17 @@ import pandas as pd
8
  import time
9
  import re
10
  from markdownify import markdownify
11
- from smolagents import Tool, DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel
12
 
13
  # (Keep Constants as is)
14
  # --- Constants ---
15
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
16
-
 
 
 
 
 
17
 
18
  class DownloadTaskAttachmentTool(Tool):
19
  name = "download_file"
@@ -95,7 +100,7 @@ class VisitWebpageTool(Tool):
95
  class BasicAgent:
96
  def __init__(self):
97
  self.agent = CodeAgent(
98
- model=LiteLLMModel(model_id="openrouter/meta-llama/llama-4-maverick:free", api_key=os.getenv("OPENROUTER_KEY")),
99
  tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
100
  add_base_tools=True,
101
  additional_authorized_imports=['pandas','numpy','csv','subprocess', 'exec']
 
8
  import time
9
  import re
10
  from markdownify import markdownify
11
+ from smolagents import Tool, DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel, HfApiModel
12
 
13
  # (Keep Constants as is)
14
  # --- Constants ---
15
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
16
+ model_qwen = HfApiModel(
17
+ model_id='Qwen/Qwen-VL-Chat',
18
+ max_tokens=2048, # Reasonable default for this model
19
+ temperature=0.2, # You can adjust this based on how creative you want answers to be
20
+ custom_role_conversions=None
21
+ )
22
 
23
  class DownloadTaskAttachmentTool(Tool):
24
  name = "download_file"
 
100
  class BasicAgent:
101
  def __init__(self):
102
  self.agent = CodeAgent(
103
+ model= model_qwen,
104
  tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
105
  add_base_tools=True,
106
  additional_authorized_imports=['pandas','numpy','csv','subprocess', 'exec']