Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,36 @@ import inspect
|
|
| 5 |
import pandas as pd
|
| 6 |
#import smolagents #to test
|
| 7 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# (Keep Constants as is)
|
| 11 |
# --- Constants ---
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
#import smolagents #to test
|
| 7 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 8 |
+
from huggingface_hub import InferenceClient
|
| 9 |
+
|
| 10 |
+
#Client setup
|
| 11 |
+
#token = HF_TOKEN
|
| 12 |
+
model_repo_id = chat_completion eller question_answering
|
| 13 |
+
|
| 14 |
+
client = InferenceClient(
|
| 15 |
+
provider="hf-inference",
|
| 16 |
+
api_key=os.environ["HF_TOKEN"],
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
completion = client.chat.completions.create(
|
| 20 |
+
model="mistralai/Magistral-Small-2506",
|
| 21 |
+
messages=[
|
| 22 |
+
{
|
| 23 |
+
"role": "user",
|
| 24 |
+
"content": "What is the capital of France?"
|
| 25 |
+
}
|
| 26 |
+
],
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
completion = client.chat.completions.create(
|
| 30 |
+
model="sarvamai/sarvam-m",
|
| 31 |
+
messages=[
|
| 32 |
+
{
|
| 33 |
+
"role": "user",
|
| 34 |
+
"content": "What is the capital of France?"
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
)
|
| 38 |
|
| 39 |
# (Keep Constants as is)
|
| 40 |
# --- Constants ---
|