fix: gracefully handle missing HF tool-calls dataset in generate-data#27
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
The default HF dataset path 404s; the script crashed instead of falling back to a synthetic prompt set or surfacing the missing-dataset error. Catch the 404, log a clear message, and fall back to a small bundled prompt set so the example command from the README still works. Fixes cactus-compute#19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
needle generate-datadefaults to the HF datasetcactus-compute/tool-calls-mix, which currently 404s. The script raised the bare HuggingFace exception, which is opaque for a first-run user. Catch the 404, log a clear message naming the dataset, and fall back to a small bundled prompt set so the README's quickstart still works without an extra flag.Why this matters
This is the #19 reproducer exactly: a fresh checkout,
needle generate-data, immediate crash on the HF fetch. The reporter spent some time finding the right--datasetflag to use as a workaround; the failure mode is much less hostile when the script names the missing dataset and falls back gracefully.Changes
needle/dataset/generate.py- wrap the HF fetch in a try/except, log "Dataset X not found, falling back to bundled prompts" onHTTPError(404), and switch to a small synthetic prompt set defined inline.Testing
needle generate-data --output /tmp/out.jsonlproduces a viable file with the bundled fallback. Passing--datasetto a working dataset path still works.Fixes #19