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
|
|
@@ -72,11 +72,12 @@ ddg = DuckDuckGoSearchTool()
|
|
| 72 |
# temperature=0.5
|
| 73 |
# )
|
| 74 |
|
| 75 |
-
model =
|
| 76 |
-
model_id="TheBloke/vicuna-7B-1.1-HF", # or
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
| 80 |
)
|
| 81 |
|
| 82 |
# Import tool from Hub
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModel, TransformersModel
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 72 |
# temperature=0.5
|
| 73 |
# )
|
| 74 |
|
| 75 |
+
model = TransformersModel(
|
| 76 |
+
model_id="TheBloke/vicuna-7B-1.1-HF", # or any other Hugging Face repo
|
| 77 |
+
device="cuda", # or "cpu"
|
| 78 |
+
max_new_tokens=1024, # how many tokens to generate
|
| 79 |
+
temperature=0.5 # same as before
|
| 80 |
+
# quantize="4bit" # optional if supported
|
| 81 |
)
|
| 82 |
|
| 83 |
# Import tool from Hub
|