How to save and read form files seems like the environment doesnt let me save anything

#67
by archit11 - opened
ZeroGPU Explorers org

error for my space here

[ExtractAudio] Destination: downloaded_audio.mp3.mp3
Deleting original file downloaded_audio.mp3 (pass -k to keep)
Audio file saved as: downloaded_audio.mp3
Reading downloaded_audio.mp3
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 216, in thread_wrapper
    res = future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/user/app/app.py", line 69, in generate_transcript
    segments = transcribe(path, model_name)
  File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 141, in gradio_handler
    return task(*args, **kwargs)
  File "/home/user/app/app.py", line 43, in transcribe
    segments, info = model.transcribe(path)
  File "/usr/local/lib/python3.10/site-packages/faster_whisper/transcribe.py", line 294, in transcribe
    audio = decode_audio(audio, sampling_rate=sampling_rate)
  File "/usr/local/lib/python3.10/site-packages/faster_whisper/audio.py", line 46, in decode_audio
    with av.open(input_file, mode="r", metadata_errors="ignore") as container:
  File "av/container/core.pyx", line 401, in av.container.core.open
  File "av/container/core.pyx", line 265, in av.container.core.Container.__cinit__
  File "av/container/core.pyx", line 285, in av.container.core.Container.err_check
  File "av/error.pyx", line 336, in av.error.err_check
av.error.FileNotFoundError: [Errno 2] No such file or directory: 'downloaded_audio.mp3'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 528, in process_events
    response = await route_utils.call_process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 270, in call_process_api
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1908, in process_api
    result = await self.call_function(
  File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1485, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 808, in wrapper
    response = f(*args, **kwargs)
  File "/home/user/app/app.py", line 167, in display_transcript
    video_path, transcript_html = download_video(youtube_url)
  File "/home/user/app/app.py", line 121, in download_video
    transcripts = generate_transcript(youtube_url)
  File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 171, in gradio_handler
    res = worker.res_queue.get()
  File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 367, in get
    return _ForkingPickler.loads(res)
  File "av/enum.pyx", line 130, in av.enum._unpickle
  File "av/enum.pyx", line 58, in av.enum.EnumType.__getitem__
KeyError: 'ERRORTYPE_2'

Sign up or log in to comment