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 lines464748494950515245 unmodified lines if not checkpoints: return None latest_checkpoint = max(checkpoints, key=lambda x: int(x.name.split("-")[1])) latest_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 lines14801481148214831483148414851486148614881487148814891490149114921492149314941495149614971498149915001501150215031504150515061507150815091510151115121479 unmodified lines self.append_log(f"Error uploading to hub: {str(e)}") return False
def get_model_output_safetensors(self) -> str: def get_model_output_safetensors(self) -> Optional[str]: """Return the path to the model safetensors Returns: Path to created ZIP file 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) return str(model_output_safetensors_path) # If not found in root, log the issue and return None logger.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 fallback checkpoints = 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 None
def create_training_dataset_zip(self) -> str: """Create a ZIP file containing all training datavms/ui/project/services/previewing.py+1-1
vms/ui/project/services/training.py+21-4