Rishi67 commited on
Commit
df6192e
·
verified ·
1 Parent(s): 8d66c6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -20,12 +20,23 @@ def get_current_time_in_timezone(timezone: str) -> str:
20
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
21
 
22
  # 2. Setup the Model
 
23
  model = InferenceClientModel(
24
  max_tokens=2096,
25
  temperature=0.5,
26
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
27
  custom_role_conversions=None,
28
  )
 
 
 
 
 
 
 
 
 
 
29
 
30
  # 3. Initialize Base Tools
31
  final_answer = FinalAnswerTool()
 
20
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
21
 
22
  # 2. Setup the Model
23
+ '''
24
  model = InferenceClientModel(
25
  max_tokens=2096,
26
  temperature=0.5,
27
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
28
  custom_role_conversions=None,
29
  )
30
+ '''
31
+ # HfApiModel is the updated standard for Hugging Face Hub inference
32
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, ManagedAgent
33
+
34
+ model = HfApiModel(
35
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
36
+ max_tokens=2096,
37
+ temperature=0.5,
38
+ token=None # It will automatically use your HF_TOKEN environment variable
39
+ )
40
 
41
  # 3. Initialize Base Tools
42
  final_answer = FinalAnswerTool()