From c54f4e7fc080b3146adb32aa2b9e798a0b0611c3 Mon Sep 17 00:00:00 2001 From: mahwiz khalil <77918472+mwzkhalil@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:31:53 -0800 Subject: [PATCH] Update finetune_gradio.py The safest approach here is to explicitly set weights_only=True to load only the model weights and avoid executing potentially unsafe code --- src/f5_tts/train/finetune_gradio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f5_tts/train/finetune_gradio.py b/src/f5_tts/train/finetune_gradio.py index 6457f45..7819447 100644 --- a/src/f5_tts/train/finetune_gradio.py +++ b/src/f5_tts/train/finetune_gradio.py @@ -974,7 +974,7 @@ def calculate_train( def extract_and_save_ema_model(checkpoint_path: str, new_checkpoint_path: str, safetensors: bool) -> str: try: - checkpoint = torch.load(checkpoint_path) + checkpoint = torch.load(checkpoint_path, weights_only=True) print("Original Checkpoint Keys:", checkpoint.keys()) ema_model_state_dict = checkpoint.get("ema_model_state_dict", None)