{"slug": "attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs", "title": "Attachements not available on https://agents-course-unit4-scoring.hf.space/docs#", "summary": "A bug in the Hugging Face agents-course Unit4 scoring Space prevents GAIA benchmark attachments from being served via the /files/{task_id} endpoint because the code uses os.path.exists() on repository-relative paths instead of downloading them. A pull request fixes the issue by resolving relative paths with hf_hub_download(), and a private duplicate with the patch has been tested successfully. The official Space has not yet applied the fix, and no public ETA from Hugging Face maintainers has been provided.", "body_md": "Ah… I only just realized that there was no PR open for this, so I opened one. If you need to unblock yourself immediately, the quickest route is probably to duplicate the scoring Space and apply the same fix. Otherwise, the next option is to wait for HF to review and merge the PR:\n\nI still do not see a public confirmation or ETA from an HF maintainer. At the time of writing, the public `Unit4_scoring`\n\nSpace still uses the old attachment-path logic, so the official `/files/{task_id}`\n\nendpoint remains affected.\n\nHowever, there is now a minimal [Space PR: Fix GAIA attachment downloads](https://huggingface.co/spaces/agents-course/Unit4_scoring/discussions/2). The same failure is also tracked in [agents-course issue #624](https://github.com/huggingface/agents-course/issues/624) and [issue #647](https://github.com/huggingface/agents-course/issues/647).\n\n| Item | Current status |\n|---|---|\n| HF maintainer confirmation / ETA | I have not seen one publicly |\n| Fix PR | Open; currently shown as ready to merge |\n| Official scoring Space | Fix not yet applied |\n| Private duplicate with the patch | Tested successfully |\n| Referenced attachments | 5/5 returned HTTP 200 |\n\nThe current [GAIA dataset documentation](https://huggingface.co/datasets/gaia-benchmark/GAIA/blob/main/README.md) describes attachment `file_path`\n\nvalues as paths relative to the dataset repository root, for example:\n\n```\n2023/validation/<task-id>.xlsx\n```\n\nThe current public [ Unit4_scoring/main.py](https://huggingface.co/spaces/agents-course/Unit4_scoring/blob/main/main.py), however, checks those values directly with\n\n`os.path.exists()`\n\nas though the files had already been materialized on the Space filesystem.The resulting flow is approximately:\n\n```\nGAIA returns a repository-relative file_path\n    ↓\nthe scoring Space checks it as an existing local path\n    ↓\nos.path.exists() returns false\n    ↓\nno task_id → local file mapping is stored\n    ↓\n/files/{task_id} returns:\n\"No file path associated with task_id ...\"\n```\n\nThis appears to be the failure point in the current public code.\n\nThe PR keeps the existing behavior for absolute local paths, but resolves repository-relative paths with `hf_hub_download()`\n\n. That downloads the attachment into the normal Hugging Face cache and gives the existing file-serving route a real local path.\n\nThe change is intentionally narrow: it does not restructure the API, question selection, submission logic, or dataset loader.\n\nI tested the change end to end on a private duplicate of the current scoring Space, using the current runtime and a read token with GAIA access.\n\nThe duplicate:\n\n`/files/{task_id}`\n\nfor:\nBefore the patch, the startup log reported:\n\n```\nStored file path mappings for 0 tasks.\n```\n\nAfter the patch:\n\n```\nStored file path mappings for 5 tasks.\n```\n\nI also checked the returned filenames, byte counts, and basic file signatures, so this was not only a successful startup or metadata-only test.\n\nFollow the [Space PR](https://huggingface.co/spaces/agents-course/Unit4_scoring/discussions/2) and the existing [#624](https://github.com/huggingface/agents-course/issues/624) / [#647](https://github.com/huggingface/agents-course/issues/647) reports.\n\nOnce the PR is merged and the official Space is rebuilt, the public `/files/{task_id}`\n\nendpoint can be checked again.\n\nDuplicate the scoring Space privately and apply the same change from the PR.\n\n**Important:** this private scoring-Space duplicate is separate from your actual Agent / Final Assignment Space. Your assignment Space can remain public for the normal course workflow; only the temporary scoring duplicate should be private.\n\nThe scoring duplicate uses its owner’s token to retrieve files from the gated GAIA dataset. If its `/files/{task_id}`\n\nendpoint were made public, it could unintentionally expose gated validation attachments outside the normal GAIA access flow.\n\nUseful references:\n\n`Unit4_scoring`\n\n`HF_TOKEN`\n\nenvironment variable", "url": "https://wpnews.pro/news/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs", "canonical_source": "https://discuss.huggingface.co/t/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs/171219#post_4", "published_at": "2026-07-12 03:46:08+00:00", "updated_at": "2026-07-12 04:16:22.436671+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Hugging Face", "agents-course", "Unit4_scoring", "GAIA"], "alternates": {"html": "https://wpnews.pro/news/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs", "markdown": "https://wpnews.pro/news/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs.md", "text": "https://wpnews.pro/news/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs.txt", "jsonld": "https://wpnews.pro/news/attachements-not-available-on-https-agents-course-unit4-scoring-hf-space-docs.jsonld"}}