mohantest commited on
Commit
a37efcb
·
verified ·
1 Parent(s): 790d28d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -2,7 +2,8 @@ import logging
2
  import hashlib
3
  import json
4
  import os
5
- from smolagents import CodeAgent, ApiModel, tool
 
6
 
7
  # Set up logging
8
  logging.basicConfig(level=logging.INFO)
@@ -69,8 +70,8 @@ def web_search(query: str) -> str:
69
  return f"Search error: {e}"
70
 
71
  # ---------- Agent ----------
72
- # Specify a Hugging Face model ID (you can change this to any compatible model)
73
- model = ApiModel(model_id="HuggingFaceH4/zephyr-7b-beta")
74
 
75
  # Only include web_search if the package is installed
76
  tools = [calculator]
 
2
  import hashlib
3
  import json
4
  import os
5
+ from smolagents import CodeAgent, tool
6
+ from smolagents.models import HfApiModel # Correct import for HfApiModel
7
 
8
  # Set up logging
9
  logging.basicConfig(level=logging.INFO)
 
70
  return f"Search error: {e}"
71
 
72
  # ---------- Agent ----------
73
+ # Use HfApiModel with a specific model ID (you can change this)
74
+ model = HfApiModel(model_id="HuggingFaceH4/zephyr-7b-beta") # or any other model
75
 
76
  # Only include web_search if the package is installed
77
  tools = [calculator]