atlonxp commited on
Commit
07b100e
·
unverified ·
1 Parent(s): 14e923a

Update get_random_sample_transcribe when absolute path is used in finetune_gradio.py

Browse files

Update `get_random_sample_transcribe` to handle absolute paths in `finetune_gradio.py`

- Added support for processing absolute file paths during transcription.
- Updated logic to correctly handle and return audio file paths with absolute URLs.
- Example use case: URLs like `https://localhost:55555/speech/150/150896/150-150896-40.wav.wav`.
- Correct one should be: `https://localhost:55555/speech/150/150896/150-150896-40.wav`.

src/f5_tts/train/finetune_gradio.py CHANGED
@@ -1177,7 +1177,10 @@ def get_random_sample_transcribe(project_name):
1177
  sp = item.split("|")
1178
  if len(sp) != 2:
1179
  continue
1180
- list_data.append([os.path.join(path_project, "wavs", sp[0] + ".wav"), sp[1]])
 
 
 
1181
 
1182
  if list_data == []:
1183
  return "", None
 
1177
  sp = item.split("|")
1178
  if len(sp) != 2:
1179
  continue
1180
+
1181
+ # fixed audio when it is absolute
1182
+ file_audio = get_correct_audio_path(sp[0], path_project)
1183
+ list_data.append([file_audio, sp[1]])
1184
 
1185
  if list_data == []:
1186
  return "", None