Spaces:
Runtime error
Runtime error
Download app.py from sdlf/Gradioapp3: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/sdlf/Gradioapp3/resolve/main/app.py
- Command line
-
hf download hf://spaces/sdlf/Gradioapp3/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sdlf/Gradioapp3/resolve/main/app.py
1.06 kB
| import gradio as gr | |
| from ..gradioapp2.file import call_with_url, call_with_api, copy_transcript | |
| demo = gr.Blocks() | |
| with demo: | |
| # Define the input components and buttons | |
| with gr.Row(): | |
| with gr.Column(scale=1): | |
| url_inputs = gr.components.Textbox(label="Input Video URL") | |
| b1 = gr.Button("Call with URL") | |
| file_inputs = gr.components.File(label="Upload Video") | |
| b2 = gr.Button("Call with File") | |
| # Define the output components | |
| with gr.Column(scale=4): | |
| url_outputs = [ | |
| gr.components.Textbox(label="Output Video URL"), | |
| gr.components.Textbox(label="Language"), | |
| gr.components.Textbox(label="Transcript Extracted"), | |
| gr.Button("Copy Transcript") | |
| ] | |
| layout = gr.Row( | |
| gr.Column([url_inputs, b1, file_inputs, b2]), | |
| gr.Column(url_outputs) | |
| ) | |
| b1.click(call_url_api, inputs=url_inputs, outputs=url_outputs) | |
| b2.click(call_upload_api, inputs=file_inputs, outputs=url_outputs) | |