Error when using Video component with Subtitle SRT

I need to display Video with subtitles.

I download the video, and have valid subtitle srt file. Below code works good on my laptop, and google colab, errors out in huggingface spaces.

I wrote a valid srt file However, it appears spaces is looking for tmpe4iw08t4.vtt which it cannot find.

Looking for pointers to make this work on spaces


    video = gr.Video(
        value=(downloaded_video, subtitles_srt_file)

Stack trace

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/gradio/", line 528, in process_events
    response = await route_utils.call_process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/", line 270, in call_process_api
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/", line 1918, in process_api
    data = await self.postprocess_data(fn_index, result["prediction"], state)
  File "/usr/local/lib/python3.10/site-packages/gradio/", line 1732, in postprocess_data
    prediction_value = postprocess_update_dict(
  File "/usr/local/lib/python3.10/site-packages/gradio/", line 605, in postprocess_update_dict
    update_dict["value"] = block.postprocess(value)
  File "/usr/local/lib/python3.10/site-packages/gradio/components/", line 260, in postprocess
  File "/usr/local/lib/python3.10/site-packages/gradio/components/", line 349, in _format_subtitle
    temp_file = tempfile.NamedTemporaryFile(
  File "/usr/local/lib/python3.10/", line 575, in NamedTemporaryFile
    file =, mode, buffering=buffering,
  File "/usr/local/lib/python3.10/", line 572, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/local/lib/python3.10/", line 256, in _mkstemp_inner
    fd =, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/gradio/tmpe4iw08t4.vtt'