PR: Fix grader inference routing by using Inference Providers (minimal code change)

#23

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 legacy
    api-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

  1. 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)
  2. requirements.txt

    • Bump:
      huggingface-hub==0.28.1 -> huggingface-hub==1.4.1

Notes for maintainers

  • The Space secret HF_TOKEN must 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.
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment