Spaces:
Build error
Build error
Julian Bilcke commited on
Commit ·
e45a45b
1
Parent(s): a120d0f
fix attempt for the download weights button
Browse filesFiles changed (2)
45 unmodified lines4647484950515245 unmodified linesif not checkpoints:return Nonelatest_checkpoint = max(checkpoints, key=lambda x: int(x.name.split("-")[1]))lora_path = latest_checkpoint / "pytorch_lora_weights.safetensors"if lora_path.exists():45 unmodified lines4647484950515245 unmodified linesif not checkpoints:return Nonelatest_checkpoint = max(checkpoints, key=lambda x: int(x.name.split("_")[-1]))lora_path = latest_checkpoint / "pytorch_lora_weights.safetensors"if lora_path.exists():
1479 unmodified lines14801481148214831484148514861487148814891490149114921493149414951479 unmodified linesself.append_log(f"Error uploading to hub: {str(e)}")return Falsedef get_model_output_safetensors(self) -> str:"""Return the path to the model safetensorsReturns:Path to created ZIP file"""model_output_safetensors_path = self.app.output_path / "pytorch_lora_weights.safetensors"return str(model_output_safetensors_path)def create_training_dataset_zip(self) -> str:"""Create a ZIP file containing all training data1479 unmodified lines1480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121479 unmodified linesself.append_log(f"Error uploading to hub: {str(e)}")return Falsedef get_model_output_safetensors(self) -> Optional[str]:"""Return the path to the model safetensorsReturns:Path to safetensors file or None if not found"""# Check if the root level file exists (this should be the primary location)model_output_safetensors_path = self.app.output_path / "pytorch_lora_weights.safetensors"if model_output_safetensors_path.exists():return str(model_output_safetensors_path)# If not found in root, log the issue and return Nonelogger.warning(f"Model weights not found at expected location: {model_output_safetensors_path}")logger.info(f"Checking output directory contents: {list(self.app.output_path.glob('*'))}")# Check if there are any checkpoint directories as a fallbackcheckpoints = list(self.app.output_path.glob("finetrainers_step_*"))if checkpoints:logger.info(f"Found {len(checkpoints)} checkpoint directories, but main weights file is missing")latest_checkpoint = max(checkpoints, key=lambda x: int(x.name.split("_")[-1]))checkpoint_weights = latest_checkpoint / "pytorch_lora_weights.safetensors"if checkpoint_weights.exists():logger.info(f"Found weights in latest checkpoint: {checkpoint_weights}")return str(checkpoint_weights)return Nonedef create_training_dataset_zip(self) -> str:"""Create a ZIP file containing all training data
vms/ui/project/services/previewing.py+1-1
vms/ui/project/services/training.py+21-4