MichaelP719 commited on
Commit
9f996c9
·
verified ·
1 Parent(s): 6154838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModel, LocalModel
2
  import datetime
3
  import requests
4
  import pytz
@@ -72,11 +72,12 @@ ddg = DuckDuckGoSearchTool()
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
 
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