Repository navigation
Studio: load S3 audio datasets — download the audio beside its manifest and point the manifest at it - #10050
Conversation
09e2127 to
0dabecd
Compare
|
Fair question: on 09e2127 a user could not reach it from the UI at all. Three frontend gates turned an audio model away from S3 with the same "vision or audio" test: Fixed in 0dabecd: all three now gate on vision alone (the modality whose references the downloader does not yet rewrite), so an audio model shows the S3 toggle, keeps the S3 form, and starts; a vision model behaves exactly as before. The Regression in |
4f4b003 to
0208ed2
Compare
|
Checked that main's |
c066e37 to
d740d66
Compare
|
hi i was out of touch lmk if i can help in anything |
|
Welcome back, and thanks. The most useful thing now would be a real run: point an audio model at an S3 prefix holding a JSONL/CSV manifest plus its audio files (the layout from #4539) on this branch, and say whether the download lands beside the manifest and the finetune starts. A review of |
…st and point the manifest at it key listing filtered audio files out, every download flattened to its basename, and a manifest+audio prefix was called a mixed-format error. So the layout unslothai#4539 asks for -- Whisper finetuning with audio files on S3 plus a transcription manifest -- could never load: at best the manifest downloaded alone and training died when datasets.Audio tried to open paths that were never materialized. Audio keys under the prefix now download too, preserving their prefix-relative structure so the manifest's relative references stay true, and the manifest's audio values are rewritten to the materialized absolute paths -- matching prefix-relative keys, s3://bucket/key URIs, the HF undecoded {"path": ...} shape, and manifest-relative paths; anything unmatched is left exactly as written. The single-format rule now judges only the manifest files (audio beside one manifest family is the expected shape; audio with no manifest is an error naming what is missing), and tabular-only prefixes keep unslothai#6222's flat collision-renamed layout byte for byte. Since the structured layout joins S3 keys into filesystem paths and bucket contents are external input, a key carrying '..' segments refuses the download instead of writing above the dataset directory. Credentials handling is untouched from unslothai#6222 (explicit keys or the default chain/IAM role, never logged or persisted). Parquet manifests cannot be rewritten without pyarrow; their audio references must already be absolute, which the module docstring now states. Closes unslothai#4539.
The backend half loads an S3 audio dataset, but the frontend still turned the source back to Browse for any audio model: dataset-section reset it with the multimodal toast, dataset-source-toggle hid the S3 option, and validateS3Source refused the start. All three gated on "vision or audio"; they now gate on vision alone, which is the modality whose references the downloader does not yet rewrite. The message that names the gate drops "or audio" in every locale. Regression in training-validation.test.ts: an audio model with a bucket validates ok, a vision model still gets s3MultimodalUnsupported. The audio case fails on the previous head. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012DRiTpjxAymRtv9p8Xr2kd
|
s3_dataset.py is upto the standards but I am looking for a real test I have access and credits on AWS s3 we could make a test bucket |
The fake-client suite pins the contract; this runs the same manifest and audio shape through boto3 and a network. It is skipped unless UNSLOTH_S3_LIVE_BUCKET names a bucket the ambient credentials can write to, uploads under a unique prefix, and deletes it afterwards. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012DRiTpjxAymRtv9p8Xr2kd
|
Thanks, and yes, a real bucket run is the right ask. Two things: 1. I ran it live over the network. Real boto3 (1.43), the branch's 2. I added that run to the PR as an opt-in test (c2a3b55): (Or leave the key vars unset to go through the default credential chain / IAM role, which is the branch's other code path.) If you can run that on real AWS and paste the one-line result here, that closes the gap I cannot close from this side. It only needs put/list/get/delete on that bucket. |
|
Ye can do. Will get back to you on that |
|
Ran this head (9cf12a5) against a real S3 API rather than mocks: a local S3-compatible server (moto 5.2.3 behind
So main hands the trainer a manifest whose every audio path dangles, which is the |
|
Review record for #10050, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#397. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Closes #4539.
What
#6222 gave training an S3 dataset source, deliberately tabular-only: the key listing filters audio files out, every download flattens to its basename, and a manifest+audio prefix trips the mixed-format validation. So the layout #4539 asks for — Whisper finetuning with audio files on S3 plus a transcription manifest — could never load: at best the manifest downloaded alone, and training died when
datasets.Audiotried to open paths that were never materialized (Audioopens path strings verbatim; nothing in the local path rebases them).How
Backend in
core/training/s3_dataset.py— the trainer, routes, andS3Configare untouched:_AUDIO_EXTENSIONSthe format detector uses), preserving their prefix-relative key structure so the manifest's relative references stay true.s3://bucket/keyURIs, the HF undecoded{"path": ...}shape, and manifest-relative paths. Anything unmatched is left exactly as written — it may be an absolute path or URL that is somebody else's contract to satisfy. JSON/JSONL/CSV manifests are rewritable; parquet would need pyarrow, so its references must already be absolute (stated in the module docstring)...segments refuses the download instead of writing above the dataset directory.Frontend (0dabecd, after review): three gates turned an audio model away from S3 with the same "vision or audio" test —
dataset-section.tsxreset the source to Browse,dataset-source-toggle.tsxhid the S3 option, andvalidateS3Sourcerefused the start — so the backend path was unreachable from the UI. They now gate on vision alone; thes3MultimodalUnsupportedstring drops "or audio" in every locale. UI flow: audio model → Dataset → Amazon S3 → bucket/prefix → Start.Credentials handling is exactly #6222's (explicit keys or the default chain / IAM role, never logged or persisted).
Verification
tests/test_s3_audio_dataset.py(9 tests, house fake-client pattern — no boto3, network, or credentials needed): structure-preserving download, both validation changes, all four reference forms rewritten (plus unmatched-left-alone), CSV and JSONL manifests, the flat-layout pin, and the traversal guard. RED-verified: 5 of the original 8 fail on unmodified main, the traversal test fails without its guard.test_s3_dataset.pytests pass unchanged — feat(studio): implement S3 dataset loading (completes #5951) #6222's contract is intact.tests/training-validation.test.tsgains the audio-ok / vision-still-refused pair (audio case fails on the previous head); 6853/6853 frontend tests, typecheck clean.test_training_resume,test_training_cached_start, S3 old+new): 213 passed. ruff clean;scripts/run_ruff_format.pymakes no further changes.cc @Huuffy (volunteered on the issue in March — review very welcome), @Androidmedaa (reporter: with this, pointing the S3 dataset source at a prefix holding your audio plus a
metadata.jsonl/.csvof transcriptions should feed the Whisper finetune directly).UI before / after
Audio model (
unsloth/whisper-large-v3-turbo) selected on the Train page. Before: merge base 729cc3f. After: a0f08b0. Each side was a separate install.With an audio model, the Dataset section now offers the Browse / Amazon S3 toggle. Before, it was hidden:
Clicking Amazon S3 opens the S3 configuration form and the source stays on S3. Before, there was nothing to click: