Spaces:
Sleeping
Sleeping
Update app.py
Browse filestry using custom_role_conversions to compensate for a model that does not support role:system ....
app.py
CHANGED
@@ -14,6 +14,7 @@ from smolagents import (
|
|
14 |
FinalAnswerTool,
|
15 |
CodeAgent,
|
16 |
InferenceClientModel,
|
|
|
17 |
PromptTemplates,
|
18 |
GradioUI
|
19 |
)
|
@@ -35,10 +36,12 @@ API_TOKEN_SMOLLM = getenv("HF_TOKEN")
|
|
35 |
# repetition_penalty=1.1
|
36 |
# )
|
37 |
|
38 |
-
model = InferenceClientModel(
|
|
|
39 |
model_id=MODEL_NAME,
|
40 |
# max_new_tokens=32768, # , # 4096,
|
41 |
token=API_TOKEN_SMOLLM
|
|
|
42 |
# temperature=0.6,
|
43 |
# top_p=0.95,
|
44 |
# top_k=20,
|
|
|
14 |
FinalAnswerTool,
|
15 |
CodeAgent,
|
16 |
InferenceClientModel,
|
17 |
+
HfApiModel,
|
18 |
PromptTemplates,
|
19 |
GradioUI
|
20 |
)
|
|
|
36 |
# repetition_penalty=1.1
|
37 |
# )
|
38 |
|
39 |
+
#model = InferenceClientModel(
|
40 |
+
model = HfApiModel(
|
41 |
model_id=MODEL_NAME,
|
42 |
# max_new_tokens=32768, # , # 4096,
|
43 |
token=API_TOKEN_SMOLLM
|
44 |
+
custom_role_conversions = {'system':'user'},
|
45 |
# temperature=0.6,
|
46 |
# top_p=0.95,
|
47 |
# top_k=20,
|