Fix Chapter 11 quiz inference routing and failure handling

#10

This PR follows up on the following forum report:

https://discuss.huggingface.co/t/chapter-11-code-quiz-fails-due-to-api-inference-huggingface-co-dns-resolution-error/177781

The grader currently fails while trying to reach api-inference.huggingface.co, after which valid alternative solutions may be marked as incorrect by the string-comparison fallback.

Changes

  • Update huggingface-hub from 0.28.1 to 1.4.1.

  • Use provider="auto" with InferenceClient.

  • Keep the existing grader model and prompt unchanged.

  • If inference fails:

    • accept an exact formatted-code match;
    • otherwise report that the grader is unavailable without changing the score or advancing the quiz.

The patch is intentionally limited to restoring current inference routing and preventing infrastructure failures from being recorded as incorrect answers.

The patched Space was also confirmed to start successfully.

"Confirming this is still broken in production — would appreciate a merge when possible" signals real user impact, which often helps deprioritized PRs get attention

Hope they merge this soon.

Still hitting this today (23 Nov 2026) on the LLM Course Chapter 11 code quiz.

Same error as above:

Error checking code: MaxRetryError('HTTPSConnectionPool(host='api-inference.huggingface.co', port=443): Max retries exceeded with url: /models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions (Caused by NameResolutionError(... Failed to resolve 'api-inference.huggingface.co' ([Errno -5] No address associated with hostname)))')

As diagnosed earlier in this thread, the grader Space (huggingface-course/sft_code_quiz) still calls the retired api-inference endpoint, and the string-comparison fallback marks correct answers as wrong.

Could a maintainer please review and merge it? This has been blocking learners from completing Chapter 11 for several months. Thanks!

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment