| import os | |
| import gradio as gr | |
| def test(txt, vid): | |
| if txt: | |
| return "./world.mp4" | |
| elif vid: | |
| return vid | |
| # iface = gr.Interface(fn=test, inputs=["text", "video"], outputs="text", examples=["test", os.path.join(os.path.dirname(__file__), 'sample.mp4')]) | |
| iface = gr.Interface(fn=test, inputs=["text", "video"], outputs=["video"]) | |
| iface.queue(max_size=2) | |
| iface.launch(share=True) | |