Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModel
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -65,15 +65,19 @@ ddg = DuckDuckGoSearchTool()
|
|
| 65 |
# custom_role_conversions=None,
|
| 66 |
# )
|
| 67 |
|
| 68 |
-
model = LiteLLMModel(
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
)
|
| 74 |
-
|
| 75 |
-
# model = OllamaQwen7BClientModel()
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
# Import tool from Hub
|
| 79 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModel, LocalModel
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 65 |
# custom_role_conversions=None,
|
| 66 |
# )
|
| 67 |
|
| 68 |
+
# model = LiteLLMModel(
|
| 69 |
+
# model_id="ollama_chat/qwen2.5:7b", # Ollama model identifier
|
| 70 |
+
# api_base="http://127.0.0.1:11434", # default Ollama HTTP port
|
| 71 |
+
# num_ctx=8192,
|
| 72 |
+
# temperature=0.5
|
| 73 |
+
# )
|
|
|
|
|
|
|
| 74 |
|
| 75 |
+
model = LocalModel(
|
| 76 |
+
model_id="TheBloke/vicuna-7B-1.1-HF", # or another HF repo you prefer
|
| 77 |
+
trust_remote_code=True, # allow custom model code
|
| 78 |
+
device="cuda", # or "cpu" if no GPU
|
| 79 |
+
quantize="4bit" # drastically reduce VRAM use
|
| 80 |
+
)
|
| 81 |
|
| 82 |
# Import tool from Hub
|
| 83 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|