themissingCRAM commited on
Commit
2a6ffa3
·
1 Parent(s): 4a206af

transformerModel

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import os
4
  from smolagents import (
5
  tool,
6
  CodeAgent,
7
- HfApiModel,
8
  GradioUI,
9
  MultiStepAgent,
10
  stream_to_gradio,
@@ -120,10 +120,10 @@ def init_db(engine):
120
  if __name__ == "__main__":
121
  engine = create_engine("sqlite:///:localhost:")
122
  engine = init_db(engine)
123
- model = HfApiModel(
124
  model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
 
125
  # model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
126
- token=os.getenv("my_first_agents_hf_tokens"),
127
  )
128
 
129
  agent = CodeAgent(
 
4
  from smolagents import (
5
  tool,
6
  CodeAgent,
7
+ TransformersModel,
8
  GradioUI,
9
  MultiStepAgent,
10
  stream_to_gradio,
 
120
  if __name__ == "__main__":
121
  engine = create_engine("sqlite:///:localhost:")
122
  engine = init_db(engine)
123
+ model = TransformersModel(
124
  model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
125
+ device_map="cuda"
126
  # model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
 
127
  )
128
 
129
  agent = CodeAgent(