ibcplateformes Claude Opus 4.6 commited on
Commit
32e0546
·
1 Parent(s): 81bdd2b

Better error messages + reduce segments to 40 for GPU time limit

Browse files

- Show full traceback in error messages for debugging
- Reduce MAX_SLICES from 80 to 40 (80 segments may exceed 60s GPU limit)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +5 -2
  2. pipeline/training.py +1 -1
app.py CHANGED
@@ -124,8 +124,11 @@ def train_voice_model(audio_file, model_name, epochs, progress=gr.Progress()):
124
  return result_msg, pth_path
125
 
126
  except Exception as e:
127
- logger.error(f"Erreur training: {e}", exc_info=True)
128
- return f"Erreur lors de l'entraînement : {str(e)}", None
 
 
 
129
 
130
 
131
  # ── Conversion Tab ───────────────────────────────────────────────────────────
 
124
  return result_msg, pth_path
125
 
126
  except Exception as e:
127
+ import traceback
128
+ tb = traceback.format_exc()
129
+ logger.error(f"Erreur training: {tb}")
130
+ # Show last 500 chars of traceback for debugging
131
+ return f"Erreur lors de l'entraînement : {type(e).__name__}: {str(e)}\n\nDétails:\n{tb[-500:]}", None
132
 
133
 
134
  # ── Conversion Tab ───────────────────────────────────────────────────────────
pipeline/training.py CHANGED
@@ -95,7 +95,7 @@ def preprocess(model_name: str, audio_path: str, sample_rate: int = 40000):
95
  segment_len_16k = int(3.5 * 16000)
96
  hop_16k = int(3.0 * 16000)
97
 
98
- MAX_SLICES = 80 # Use all available audio for better quality
99
 
100
  n_slices = 0
101
  idx = 0
 
95
  segment_len_16k = int(3.5 * 16000)
96
  hop_16k = int(3.0 * 16000)
97
 
98
+ MAX_SLICES = 40 # Balance quality vs GPU time (60s ZeroGPU limit)
99
 
100
  n_slices = 0
101
  idx = 0