Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -174,6 +174,10 @@ model = HfApiModel(
|
|
| 174 |
custom_role_conversions=None,
|
| 175 |
)
|
| 176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
# Import tool from Hub
|
| 178 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 179 |
|
|
|
|
| 174 |
custom_role_conversions=None,
|
| 175 |
)
|
| 176 |
|
| 177 |
+
# Patch: Ensure last_input_token_count is initialized to 0 if not already set.
|
| 178 |
+
if model.last_input_token_count is None:
|
| 179 |
+
model.last_input_token_count = 0
|
| 180 |
+
|
| 181 |
# Import tool from Hub
|
| 182 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 183 |
|