jbilcke-hf HF Staff commited on
Commit
61b4672
·
1 Parent(s): 21e03a6
degraded_requirements.txt CHANGED
@@ -36,7 +36,7 @@ av==14.1.0
36
  git+https://github.com/LLaVA-VL/LLaVA-NeXT.git
37
 
38
  # for our frontend
39
- gradio==5.32.1
40
  gradio_toggle
41
  gradio_modal
42
 
 
36
  git+https://github.com/LLaVA-VL/LLaVA-NeXT.git
37
 
38
  # for our frontend
39
+ gradio==5.33.1
40
  gradio_toggle
41
  gradio_modal
42
 
vms/ui/project/services/training.py CHANGED
@@ -1496,9 +1496,45 @@ class TrainingService:
1496
  lora_weights_dir = self.app.output_path / "lora_weights"
1497
  if lora_weights_dir.exists():
1498
  logger.info(f"Found lora_weights directory: {lora_weights_dir}")
1499
- lora_weights_contents = list(lora_weights_dir.glob("*"))
1500
- logger.info(f"Contents of lora_weights directory: {lora_weights_contents}")
1501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1502
  lora_safetensors = lora_weights_dir / "pytorch_lora_weights.safetensors"
1503
  if lora_safetensors.exists():
1504
  logger.info(f"Found weights in lora_weights directory: {lora_safetensors}")
 
1496
  lora_weights_dir = self.app.output_path / "lora_weights"
1497
  if lora_weights_dir.exists():
1498
  logger.info(f"Found lora_weights directory: {lora_weights_dir}")
 
 
1499
 
1500
+ # Look for the latest checkpoint directory in lora_weights
1501
+ lora_checkpoints = [d for d in lora_weights_dir.glob("*") if d.is_dir() and d.name.isdigit()]
1502
+ if lora_checkpoints:
1503
+ latest_lora_checkpoint = max(lora_checkpoints, key=lambda x: int(x.name))
1504
+ logger.info(f"Found latest LoRA checkpoint: {latest_lora_checkpoint}")
1505
+
1506
+ # List contents of the latest checkpoint directory
1507
+ checkpoint_contents = list(latest_lora_checkpoint.glob("*"))
1508
+ logger.info(f"Contents of LoRA checkpoint {latest_lora_checkpoint.name}: {checkpoint_contents}")
1509
+
1510
+ # Check for weights in the latest LoRA checkpoint
1511
+ lora_safetensors = latest_lora_checkpoint / "pytorch_lora_weights.safetensors"
1512
+ if lora_safetensors.exists():
1513
+ logger.info(f"Found weights in latest LoRA checkpoint: {lora_safetensors}")
1514
+ return str(lora_safetensors)
1515
+
1516
+ # Also check for other common weight file names
1517
+ possible_weight_files = [
1518
+ "pytorch_lora_weights.safetensors",
1519
+ "adapter_model.safetensors",
1520
+ "pytorch_model.safetensors",
1521
+ "model.safetensors"
1522
+ ]
1523
+
1524
+ for weight_file in possible_weight_files:
1525
+ weight_path = latest_lora_checkpoint / weight_file
1526
+ if weight_path.exists():
1527
+ logger.info(f"Found weights file {weight_file} in latest LoRA checkpoint: {weight_path}")
1528
+ return str(weight_path)
1529
+
1530
+ # Check if any .safetensors files exist
1531
+ safetensors_files = list(latest_lora_checkpoint.glob("*.safetensors"))
1532
+ if safetensors_files:
1533
+ logger.info(f"Found .safetensors files in LoRA checkpoint: {safetensors_files}")
1534
+ # Return the first .safetensors file found
1535
+ return str(safetensors_files[0])
1536
+
1537
+ # Fallback: check for direct safetensors file in lora_weights root
1538
  lora_safetensors = lora_weights_dir / "pytorch_lora_weights.safetensors"
1539
  if lora_safetensors.exists():
1540
  logger.info(f"Found weights in lora_weights directory: {lora_safetensors}")