Samfredoly commited on
Commit
0a257b1
·
verified ·
1 Parent(s): c26067a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -302,8 +302,8 @@ async def download_wav_file_by_index(file_index: int, repo_file_full_path: str)
302
 
303
  async def upload_transcription_to_hf(wav_filename: str, transcription_data: Dict) -> bool:
304
  """Uploads the transcription JSON file to the output dataset."""
305
- # Use the WAV filename, replacing the extension with .json
306
- json_filename = Path(wav_filename).with_suffix('.json').name
307
 
308
  try:
309
  print(f"[{FLOW_ID}] Uploading transcription for {wav_filename} as {json_filename} to {HF_OUTPUT_DATASET_ID}...")
 
302
 
303
  async def upload_transcription_to_hf(wav_filename: str, transcription_data: Dict) -> bool:
304
  """Uploads the transcription JSON file to the output dataset."""
305
+ # Use the full WAV path, replacing slashes with underscores and extension with .json
306
+ json_filename = wav_filename.replace('/', '_').replace('\\', '_').rsplit('.', 1)[0] + '.json'
307
 
308
  try:
309
  print(f"[{FLOW_ID}] Uploading transcription for {wav_filename} as {json_filename} to {HF_OUTPUT_DATASET_ID}...")