Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
README.md
CHANGED
|
@@ -36,7 +36,11 @@ itself.
|
|
| 36 |
To run it (locally or as a Space), set the `HF_TOKEN` secret/env var to a
|
| 37 |
Hugging Face access token with Inference API permission. Optionally set
|
| 38 |
`HF_AGENT_MODEL` to override the default model
|
| 39 |
-
(`
|
| 40 |
default Inference Provider (`together`) — pinned explicitly because the
|
| 41 |
router's `auto` selection can land on a provider that doesn't support tool
|
| 42 |
-
calling for a given model (HTTP 422 `UNSUPPORTED_OPENAI_PARAMS`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
To run it (locally or as a Space), set the `HF_TOKEN` secret/env var to a
|
| 37 |
Hugging Face access token with Inference API permission. Optionally set
|
| 38 |
`HF_AGENT_MODEL` to override the default model
|
| 39 |
+
(`meta-llama/Llama-3.3-70B-Instruct`), and `HF_AGENT_PROVIDER` to override the
|
| 40 |
default Inference Provider (`together`) — pinned explicitly because the
|
| 41 |
router's `auto` selection can land on a provider that doesn't support tool
|
| 42 |
+
calling for a given model (HTTP 422 `UNSUPPORTED_OPENAI_PARAMS`), and not every
|
| 43 |
+
provider hosts every model (HTTP 4xx "Model ... is not supported by provider
|
| 44 |
+
..."). Check `https://router.huggingface.co/v1/models/<repo_id>` to see which
|
| 45 |
+
providers host a given model and whether they support tools before changing
|
| 46 |
+
either variable.
|
agent.py
CHANGED
|
@@ -30,7 +30,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 30 |
|
| 31 |
# Any HF Inference API model that supports tool calling works here. Override via the
|
| 32 |
# HF_AGENT_MODEL env var without touching code.
|
| 33 |
-
HF_MODEL_REPO_ID = os.getenv("HF_AGENT_MODEL", "
|
| 34 |
|
| 35 |
# Left unset ("auto"), the HF router picks whichever provider is cheapest/fastest for the
|
| 36 |
# model, and some of those don't support the `tools` param at all (HTTP 422
|
|
|
|
| 30 |
|
| 31 |
# Any HF Inference API model that supports tool calling works here. Override via the
|
| 32 |
# HF_AGENT_MODEL env var without touching code.
|
| 33 |
+
HF_MODEL_REPO_ID = os.getenv("HF_AGENT_MODEL", "meta-llama/Llama-3.3-70B-Instruct")
|
| 34 |
|
| 35 |
# Left unset ("auto"), the HF router picks whichever provider is cheapest/fastest for the
|
| 36 |
# model, and some of those don't support the `tools` param at all (HTTP 422
|