gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.63k stars 2.55k forks source link

gr.render bug for Video #9248

Closed zhhphappy closed 1 month ago

zhhphappy commented 2 months ago

Describe the bug

When I use gr.render, gr.Video can not found video path.

Have you searched existing issues? 🔎

Reproduction

from fastapi import FastAPI
import gradio as gr
import uvicorn

app = FastAPI()
test_video_path = '/workspace/video.mp4'

with gr.Blocks() as demo:
    text = gr.Text()
    video1 = gr.Video(test_video_path)

    @gr.render(inputs=text)
    def show_video(data):
        video2 = gr.Video(test_video_path)

app = gr.mount_gradio_app(app, demo, path="/test")
uvicorn.run(app, port=8180)

Screenshot

No response

Logs

No response

System Info

Python 3.10.14
gradio Version: 4.41.0

Severity

Blocking usage of gradio

freddyaboulton commented 1 month ago

I know what the issue is @zhhphappy !