Problem showing mp4 examples on Spaces


I have a problem with Gradio and HuggingFace Spaces.
The problem is that when I try to set examples in this way:

intput_components = [

output_components = "playablevideo"

example_list = [["examples/" + example] for example in os.listdir("examples")]

iface = gr.Interface(


where each element of the input_components list is a Gradio component.

When I run this code locally I do not have any problems showing the examples (mp4 videos).

I have Git LFS set properly.

This is the error that the logs show me when I run this code on Spaces, but if I remove the attribute examples there is no error in that execution. For this reason, I do not understand the error and there is any possibility of a bug on the deploy process.

Traceback (most recent call last):
  File "", line 40, in <module>
    iface = gr.Interface(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 626, in __init__
    self.examples_handler = Examples(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 56, in create_examples
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 364, in synchronize_async
    return fsspec.asyn.sync(fsspec.asyn.get_loop(), func, *args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/fsspec/", line 96, in sync
    raise return_result
  File "/home/user/.local/lib/python3.8/site-packages/fsspec/", line 53, in _runner
    result[0] = await coro
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 208, in create
    await self.cache_interface_examples()
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 246, in cache_interface_examples
    prediction = await self.predict_example(example_id)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/", line 263, in predict_example
    predictions = await anyio.to_thread.run_sync(self.fn, *processed_input)
  File "/home/user/.local/lib/python3.8/site-packages/anyio/", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/user/.local/lib/python3.8/site-packages/anyio/_backends/", line 937, in run_sync_in_worker_thread
    return await future
  File "/home/user/.local/lib/python3.8/site-packages/anyio/_backends/", line 867, in run
    result =, *args)
TypeError: inference() missing 4 required positional arguments: 'model', 'features', 'track_points', and 'model_threshold'

Hello @diegofernandezc,

Do you still have issues with your space ? Is so could you provide the link to the space ?

Hello @chris-rannou

This is the space: Norfair - a Hugging Face Space by tryolabs

I can confirm the examples files are included in the deployed space.
I tried and submit one of them norfair_demo.mp4 which worked as expected.
Did you check the gradio version locally matches the one for the space ?
Could you try adding the examples with an absolute path ? (/home/user/app/examples)

@diegofernandezc Can you try setting cache_examples=False in the interface init? This is a bug in gradio. By default on spaces, gradio will try to cache the example outputs but that will not work if only some of the inputs are provided as examples.

Thanks @freddyaboulton this was the solution to my problem.


Thanks for the reply @chris-rannou, the solution was the @freddyaboulton reply.


Hi again @chris-rannou @freddyaboulton

I fixed this problem by setting default arguments to the function called by the interface.

This function fails with cache_examples=True because when the app starts it doesn’t receive any arguments to run over the example videos.


Thanks @diegofernandezc ! I filed this github issue a couple of days ago to provide a clearer error message in this case: Interfaces which provide partial examples will crash on Spaces · Issue #2239 · gradio-app/gradio · GitHub