Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
-
from smolagents import GradioUI, CodeAgent
|
|
|
|
| 4 |
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -46,8 +47,8 @@ class CountedLiteLLMModel(LiteLLMModel):
|
|
| 46 |
return out
|
| 47 |
|
| 48 |
model = CountedLiteLLMModel(
|
| 49 |
-
model_id='claude-3-5-sonnet-latest',
|
| 50 |
-
api_key=os.getenv('ANTHROPIC_API_KEY'),
|
| 51 |
)
|
| 52 |
|
| 53 |
web_search = WebSearch()
|
|
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
+
from smolagents import GradioUI, CodeAgent, LiteLLMModel
|
| 4 |
+
from litellm import token_counter # fallback when provider doesn't return usage
|
| 5 |
|
| 6 |
# Get current directory path
|
| 7 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
| 47 |
return out
|
| 48 |
|
| 49 |
model = CountedLiteLLMModel(
|
| 50 |
+
model_id='claude-3-5-sonnet-latest',
|
| 51 |
+
api_key=os.getenv('ANTHROPIC_API_KEY'),
|
| 52 |
)
|
| 53 |
|
| 54 |
web_search = WebSearch()
|