blasisd commited on
Commit
4a50501
·
1 Parent(s): 5668246

Using HfApiModel with specific provider

Browse files
Files changed (1) hide show
  1. app.py +14 -21
app.py CHANGED
@@ -9,7 +9,7 @@ from doctest import debug
9
  from dotenv import load_dotenv
10
  from smolagents import (
11
  CodeAgent,
12
- # HfApiModel,
13
  LiteLLMModel,
14
  # OpenAIServerModel,
15
  Tool,
@@ -97,30 +97,23 @@ class BasicAgent:
97
  def __init__(self):
98
  print("BasicAgent initialized.")
99
 
100
- # model = OpenAIServerModel(
101
- # model_id="qwen/qwen2.5-vl-7b",
102
- # api_base="http://localhost:1234/v1",
103
- # api_key="not-needed",
104
- # max_tokens=8192,
 
105
  # )
106
 
107
- model = LiteLLMModel(
108
- model_id=LLM_MODEL_ID,
109
- api_base=LLM_API_BASE,
110
- api_key=LLM_API_KEY,
111
- num_ctx=8192,
112
- # flatten_messages_as_text=False,
 
113
  )
114
 
115
- # model = HfApiModel(
116
- # max_tokens=4096,
117
- # temperature=0.5,
118
- # provider="novita",
119
- # model_id="Qwen/Qwen3-32B",
120
- # custom_role_conversions=None,
121
- # token=HF_TOKEN,
122
- # )
123
-
124
  self.agent = CodeAgent(
125
  tools=[
126
  file_downloader_tool,
 
9
  from dotenv import load_dotenv
10
  from smolagents import (
11
  CodeAgent,
12
+ HfApiModel,
13
  LiteLLMModel,
14
  # OpenAIServerModel,
15
  Tool,
 
97
  def __init__(self):
98
  print("BasicAgent initialized.")
99
 
100
+ # model = LiteLLMModel(
101
+ # model_id=LLM_MODEL_ID,
102
+ # api_base=LLM_API_BASE,
103
+ # api_key=LLM_API_KEY,
104
+ # num_ctx=8192,
105
+ # # flatten_messages_as_text=False,
106
  # )
107
 
108
+ model = HfApiModel(
109
+ max_tokens=4096,
110
+ temperature=0.5,
111
+ provider="novita",
112
+ model_id="Qwen/Qwen3-32B",
113
+ custom_role_conversions=None,
114
+ token=HF_TOKEN,
115
  )
116
 
 
 
 
 
 
 
 
 
 
117
  self.agent = CodeAgent(
118
  tools=[
119
  file_downloader_tool,