sugakrit6 commited on
Commit
d02d6a9
·
verified ·
1 Parent(s): 76c7846

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -247,15 +247,15 @@ Output: {result.stdout if result.stdout else 'Processing completed'}
247
  str(train_script),
248
  "-e", model_name,
249
  "-sr", str(sample_rate),
250
- "-f0", "1", # Use F0
251
  "-bs", str(batch_size),
252
- "-g", "0", # GPU index (0 for CPU)
253
  "-te", str(epochs),
254
- "-se", "10", # Save every N epochs
255
  "-pg", str(self.rvc_dir / "pretrained" / "f0G40k.pth"),
256
  "-pd", str(self.rvc_dir / "pretrained" / "f0D40k.pth"),
257
- "-l", "0", # No cache
258
- "-c", "0" # No cache
259
  ]
260
 
261
  progress(0.2, desc=f"Training {model_name}...")
@@ -292,26 +292,22 @@ Output: {result.stdout if result.stdout else 'Processing completed'}
292
  if path.exists():
293
  model_files.extend(list(path.glob("**/*.pth")))
294
 
295
- # Also search for index files
296
  index_files = []
297
  for path in possible_paths:
298
  if path.exists():
299
  index_files.extend(list(path.glob("**/*.index")))
300
 
301
  if model_files or index_files:
302
- # Create output directory
303
  output_dir = self.workspace / model_name
304
  output_dir.mkdir(exist_ok=True)
305
 
306
- # Copy model file
307
  if model_files:
308
  latest_model = max(model_files, key=lambda p: p.stat().st_mtime)
309
  shutil.copy2(latest_model, output_dir / f"{model_name}.pth")
310
- model_size = latest_model.stat().st_size / (1024*1024) # MB
311
  else:
312
  model_size = 0
313
 
314
- # Copy index file
315
  if index_files:
316
  latest_index = max(index_files, key=lambda p: p.stat().st_mtime)
317
  shutil.copy2(latest_index, output_dir / latest_index.name)
@@ -339,7 +335,6 @@ Output: {result.stdout if result.stdout else 'Processing completed'}
339
  🎉 Ready to download!
340
  """
341
  else:
342
- # List what's in the log directory for debugging
343
  debug_info = []
344
  if log_dir.exists():
345
  debug_info.append(f"Log directory exists: {log_dir}")
 
247
  str(train_script),
248
  "-e", model_name,
249
  "-sr", str(sample_rate),
250
+ "-f0", "1",
251
  "-bs", str(batch_size),
252
+ "-g", "0",
253
  "-te", str(epochs),
254
+ "-se", "10",
255
  "-pg", str(self.rvc_dir / "pretrained" / "f0G40k.pth"),
256
  "-pd", str(self.rvc_dir / "pretrained" / "f0D40k.pth"),
257
+ "-l", "0",
258
+ "-c", "0"
259
  ]
260
 
261
  progress(0.2, desc=f"Training {model_name}...")
 
292
  if path.exists():
293
  model_files.extend(list(path.glob("**/*.pth")))
294
 
 
295
  index_files = []
296
  for path in possible_paths:
297
  if path.exists():
298
  index_files.extend(list(path.glob("**/*.index")))
299
 
300
  if model_files or index_files:
 
301
  output_dir = self.workspace / model_name
302
  output_dir.mkdir(exist_ok=True)
303
 
 
304
  if model_files:
305
  latest_model = max(model_files, key=lambda p: p.stat().st_mtime)
306
  shutil.copy2(latest_model, output_dir / f"{model_name}.pth")
307
+ model_size = latest_model.stat().st_size / (1024*1024)
308
  else:
309
  model_size = 0
310
 
 
311
  if index_files:
312
  latest_index = max(index_files, key=lambda p: p.stat().st_mtime)
313
  shutil.copy2(latest_index, output_dir / latest_index.name)
 
335
  🎉 Ready to download!
336
  """
337
  else:
 
338
  debug_info = []
339
  if log_dir.exists():
340
  debug_info.append(f"Log directory exists: {log_dir}")