From 4afcce622ec8adfc2692205fbb95de05f69dbfbf Mon Sep 17 00:00:00 2001 From: Luca Bruni Date: Thu, 20 Aug 2026 16:33:52 -0400 Subject: [PATCH 1/3] pytorch-finetuning, speech2speech: bump transformers 4.57.1 -> 5.10.1 --- playbooks/supplemental/pytorch-finetuning/README.md | 4 ++-- playbooks/supplemental/speech2speech-translation/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/supplemental/pytorch-finetuning/README.md b/playbooks/supplemental/pytorch-finetuning/README.md index c588f521..1d95bb19 100644 --- a/playbooks/supplemental/pytorch-finetuning/README.md +++ b/playbooks/supplemental/pytorch-finetuning/README.md @@ -135,7 +135,7 @@ finetune-venv\Scripts\activate ```bash -pip install transformers==4.57.1 safetensors==0.6.2 accelerate peft trl bitsandbytes "fsspec[http]>=2023.1.0,<=2025.9.0" +pip install transformers==5.10.1 safetensors==0.6.2 accelerate peft trl bitsandbytes "fsspec[http]>=2023.1.0,<=2025.9.0" ``` @@ -144,7 +144,7 @@ pip install transformers==4.57.1 safetensors==0.6.2 accelerate peft trl bitsandb **Windows:** Only core packages are tested and supported here. **bitsandbytes is not well supported on Windows**, so the Windows install omits it; use LoRA or full fine-tuning on Windows (QLoRA requires bitsandbytes and is intended for Linux). ```bash -pip install transformers==4.57.1 safetensors==0.6.2 datasets==4.2.0 accelerate peft trl "fsspec[http]>=2023.1.0,<=2025.9.0" +pip install transformers==5.10.1 safetensors==0.6.2 datasets==4.2.0 accelerate peft trl "fsspec[http]>=2023.1.0,<=2025.9.0" ``` diff --git a/playbooks/supplemental/speech2speech-translation/README.md b/playbooks/supplemental/speech2speech-translation/README.md index eb4ac12d..9cfac80d 100644 --- a/playbooks/supplemental/speech2speech-translation/README.md +++ b/playbooks/supplemental/speech2speech-translation/README.md @@ -127,7 +127,7 @@ s2st-env\Scripts\activate Install m4t dependencies using pip: ```bash -pip install transformers==4.57.1 safetensors==0.6.2 tiktoken==0.9.0 accelerate soundfile==0.13.1 sentencepiece protobuf gradio scipy==1.15.3 +pip install transformers==5.10.1 safetensors==0.6.2 tiktoken==0.9.0 accelerate soundfile==0.13.1 sentencepiece protobuf gradio scipy==1.15.3 ``` From b62a60e52227a5c2d186b1144efe7ca1dce14c8f Mon Sep 17 00:00:00 2001 From: Luca Bruni Date: Fri, 21 Aug 2026 11:36:35 -0400 Subject: [PATCH 2/3] pytorch-finetuning: drop save_safetensors from SFTConfig transformers 5 removed save_safetensors from TrainingArguments (safetensors is now the only serialization format), so SFTConfig no longer accepts it and the training scripts raised TypeError. Removing the arg keeps the same behavior since safetensors saving is the default. --- .../pytorch-finetuning/assets/train_full_finetuning.py | 1 - playbooks/supplemental/pytorch-finetuning/assets/train_lora.py | 1 - playbooks/supplemental/pytorch-finetuning/assets/train_qlora.py | 1 - 3 files changed, 3 deletions(-) diff --git a/playbooks/supplemental/pytorch-finetuning/assets/train_full_finetuning.py b/playbooks/supplemental/pytorch-finetuning/assets/train_full_finetuning.py index 9f1bf2dc..31835532 100644 --- a/playbooks/supplemental/pytorch-finetuning/assets/train_full_finetuning.py +++ b/playbooks/supplemental/pytorch-finetuning/assets/train_full_finetuning.py @@ -171,7 +171,6 @@ def format_chat(ex): logging_steps=5, save_strategy="epoch", eval_strategy="epoch", - save_safetensors=True, save_total_limit=1, # Keep only last checkpoint to save disk space # Other diff --git a/playbooks/supplemental/pytorch-finetuning/assets/train_lora.py b/playbooks/supplemental/pytorch-finetuning/assets/train_lora.py index dce9e525..aed16228 100644 --- a/playbooks/supplemental/pytorch-finetuning/assets/train_lora.py +++ b/playbooks/supplemental/pytorch-finetuning/assets/train_lora.py @@ -230,7 +230,6 @@ def format_chat(ex): logging_steps=5, save_strategy="epoch", eval_strategy="epoch", - save_safetensors=True, save_total_limit=2, # Other diff --git a/playbooks/supplemental/pytorch-finetuning/assets/train_qlora.py b/playbooks/supplemental/pytorch-finetuning/assets/train_qlora.py index 74d7a9c1..fb696b32 100644 --- a/playbooks/supplemental/pytorch-finetuning/assets/train_qlora.py +++ b/playbooks/supplemental/pytorch-finetuning/assets/train_qlora.py @@ -254,7 +254,6 @@ def make_inputs_require_grad(module, input, output): logging_steps=5, save_strategy="epoch", eval_strategy="epoch", - save_safetensors=True, save_total_limit=2, # Other From c36db1695206641015ff66b885bf8aa57068dc17 Mon Sep 17 00:00:00 2001 From: Luca Bruni Date: Fri, 21 Aug 2026 11:56:43 -0400 Subject: [PATCH 3/3] pytorch-finetuning: accept single-file model save in full-FT output check transformers 5 raised the default max_shard_size (5GB -> 50GB), so the smoke model now saves as a single model.safetensors instead of sharded files with an index. Accept either layout in verify-full-finetuning-output. --- playbooks/supplemental/pytorch-finetuning/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/playbooks/supplemental/pytorch-finetuning/README.md b/playbooks/supplemental/pytorch-finetuning/README.md index 1d95bb19..f2cbd3f2 100644 --- a/playbooks/supplemental/pytorch-finetuning/README.md +++ b/playbooks/supplemental/pytorch-finetuning/README.md @@ -465,16 +465,18 @@ required = [ "config.json", "tokenizer_config.json", "tokenizer.json", - "model.safetensors.index.json", ] missing = [f for f in required if not os.path.exists(os.path.join(out_dir, f))] if missing: print(f"FAIL: Missing required files: {missing}") sys.exit(1) +# Weights may be saved as a single model.safetensors or, when the model +# exceeds max_shard_size, as model-*.safetensors shards plus an index. +single = os.path.exists(os.path.join(out_dir, "model.safetensors")) shards = glob.glob(os.path.join(out_dir, "model-*.safetensors")) -if not shards: - print("FAIL: No sharded model safetensors files found") +if not single and not shards: + print("FAIL: No model safetensors weights found") sys.exit(1) print(f"PASS: Full fine-tuned model output looks correct: {out_dir}")