PR: Fix grader inference routing by using Inference Providers (minimal code change)
#23
by John6666 - opened
Reported on https://discuss.huggingface.co/t/bug-unit-2-1-quiz-410-client-error-legacy-api-endpoint/173189
Summary
- The Space currently instantiates
InferenceClient(model=..., token=...)which can hit the legacyapi-inference.huggingface.co/models/...path in older/legacy configurations and now fails with HTTP 410 Gone. - This PR makes the smallest possible change to force routing via Inference Providers.
Changes
app.py
- Change one line:
from: client = InferenceClient(model=HF_API_URL, token=HF_TOKEN)
to: client = InferenceClient(model=HF_API_URL, provider="auto", token=HF_TOKEN)
- Change one line:
requirements.txt
- Bump:
huggingface-hub==0.28.1 -> huggingface-hub==1.4.1
- Bump:
Notes for maintainers
- The Space secret
HF_TOKENmust be a token that is allowed to call Inference Providers. provider="auto"uses the account’s provider preference order and can fail over if multiple providers support the model.