You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m currently using Unsloth Studio to fine-tune unsloth/ Whisper Large v3, and I have a question regarding dataset ingestion. My dataset consists of audio files stored privately on AWS S3 along with their corresponding transcriptions. I’d like to know whether Unsloth Studio supports direct integration with S3 (e.g., via bucket paths, IAM roles, or signed URLs) during the dataset upload step. At the moment, I’m unsure if there is a built-in way to connect an S3 bucket or if all data must first be downloaded locally to the instance. Could you clarify if this feature exists, is planned, or if there is a recommended workaround for securely using private S3-hosted audio datasets within Unsloth Studio?
Currently, direct S3 integration is not yet built into the Unsloth Studio UI. The Studio currently supports:
Hugging Face Hub: Loading public/private datasets via HF tokens.
Local Uploads: Direct file uploads (JSON, CSV, PDF, etc.).
2. Recommended Python Workaround
Since Unsloth is built on top of the Hugging Face datasets ecosystem, you can bridge the gap using s3fs. This allows you to stream data directly from your private bucket without a full local download.
Here is a snippet to get you started:
imports3fsfromdatasetsimportload_datasetfromunslothimportFastWhisperModel# 1. Setup S3 connection# Ensure your environment has AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY setfs=s3fs.S3FileSystem()
# 2. Load your metadata/manifest directly from S3# Assumes your CSV contains S3 paths to the actual audio filesdataset=load_dataset("csv", data_files="s3://your-bucket-name/metadata.csv")
# 3. Mapping function to fetch audio bytes on-the-flydefmap_audio_from_s3(batch):
# This fetches the specific audio file from S3 during the mapping/training processwithfs.open(batch["audio_s3_path"], "rb") asf:
batch["audio"] = {"array": f.read(), "sampling_rate": 16000}
returnbatchdataset=dataset.map(map_audio_from_s3)
I have extensive experience working with AWS S3 and cloud-native architectures. My proposed implementation would focus on:
Secure Credential Handling: Developing a workflow that allows users to select S3 as a source and securely input credentials (or use IAM roles/session tokens). These would be managed via .env or temporary environment variables to maintain strict confidentiality and follow security best practices.
Native Ingestion: Adding a dedicated S3 connector to the backend logic. This will enable the same high-performance "streaming" capability used for Hugging Face datasets, but natively for private S3 buckets within the Unsloth environment.
I believe this would be a high-value addition for enterprise users and anyone handling private datasets. Please let me know if I should proceed with a Pull Request or if you have specific architectural preferences I should follow!
Picking this up (@Huuffy — you volunteered back in March; since no PR appeared in the five months since I'll carry it, but happy to fold in your review or cede to WIP if you have any).
State of the world since this was filed: #6222 shipped S3 dataset loading (core/training/s3_dataset.py — bucket/prefix/credentials or IAM-role config, download to a temp dir, feed the local-file loader). What it deliberately supports is tabular files only (.parquet/.json/.jsonl/.csv): the key listing filters audio files out, the download flattens paths (so a audio/x.wav reference in a metadata file would break even if downloaded), and the single-format validation would reject a metadata+audio mix outright. So the exact case this issue asks about — Whisper finetuning with audio on S3 plus a transcription manifest — still fails.
Scoped plan, contained in s3_dataset.py so the trainer and routes stay untouched:
List audio keys too (the same _AUDIO_EXTENSIONS the format detector uses).
Single-format validation applies to the metadata files only; audio alongside is expected, audio with no metadata file is a clear error naming what's missing.
When audio is present, preserve prefix-relative key structure on download (flat behavior unchanged for today's tabular-only prefixes).
Rewrite the downloaded metadata's audio references to the materialized local paths — matching prefix-relative keys, s3://bucket/key URIs, and metadata-file-relative paths; anything unmatched is left alone.
Credentials handling stays exactly as #6222 built it (explicit keys or default chain/IAM, never persisted). Tests follow the existing test_s3_dataset.py fake-client pattern, so they run without AWS.
I'd like to take this one ([Feature] Unsloth/ Whisper/Large-v3 - S3 Bucket connection). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)
I'd like to take this one ([Feature] Unsloth/ Whisper/Large-v3 - S3 Bucket connection). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)
Activity
Huuffy commentedon Mar 29, 2026
Hi @Androidmedaa,
To answer your questions:
1. Does this feature currently exist?
Currently, direct S3 integration is not yet built into the Unsloth Studio UI. The Studio currently supports:
2. Recommended Python Workaround
Since Unsloth is built on top of the Hugging Face
datasetsecosystem, you can bridge the gap usings3fs. This allows you to stream data directly from your private bucket without a full local download.Here is a snippet to get you started:
Huuffy commentedon Mar 29, 2026
Hi @danielhanchen, @hiyouga, and @Datta0 - I would like to officially volunteer to implement this feature.
I have extensive experience working with AWS S3 and cloud-native architectures. My proposed implementation would focus on:
.envor temporary environment variables to maintain strict confidentiality and follow security best practices.I believe this would be a high-value addition for enterprise users and anyone handling private datasets. Please let me know if I should proceed with a Pull Request or if you have specific architectural preferences I should follow!
Androidmedaa commentedon Apr 5, 2026
@Huuffy Thank you!!
feat(studio): add S3 dataset configuration foundation (unslothai#4539)
feat(studio): implement S3 dataset loading (completes #5951) (#6222)
lonexreb commentedon Aug 31, 2026
Picking this up (@Huuffy — you volunteered back in March; since no PR appeared in the five months since I'll carry it, but happy to fold in your review or cede to WIP if you have any).
State of the world since this was filed: #6222 shipped S3 dataset loading (
core/training/s3_dataset.py— bucket/prefix/credentials or IAM-role config, download to a temp dir, feed the local-file loader). What it deliberately supports is tabular files only (.parquet/.json/.jsonl/.csv): the key listing filters audio files out, the download flattens paths (so aaudio/x.wavreference in a metadata file would break even if downloaded), and the single-format validation would reject a metadata+audio mix outright. So the exact case this issue asks about — Whisper finetuning with audio on S3 plus a transcription manifest — still fails.Scoped plan, contained in
s3_dataset.pyso the trainer and routes stay untouched:_AUDIO_EXTENSIONSthe format detector uses).s3://bucket/keyURIs, and metadata-file-relative paths; anything unmatched is left alone.Credentials handling stays exactly as #6222 built it (explicit keys or default chain/IAM, never persisted). Tests follow the existing
test_s3_dataset.pyfake-client pattern, so they run without AWS.LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
[Feature] Unsloth/ Whisper/Large-v3 - S3 Bucket connection). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
[Feature] Unsloth/ Whisper/Large-v3 - S3 Bucket connection). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets — download the audio beside its manife…
Studio: load S3 audio datasets by downloading the audio beside its ma…