File size: 1,306 Bytes
1d179ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from summarize import Summarizer

interface = gr.Interface(fn = Summarizer,
                        inputs = [gr.inputs.Textbox(lines=2, 
                                                    placeholder="Enter your link...",
                                                    label='YouTube Video Link'),
                                  gr.inputs.Radio(["mT5", "BART"], type="value", label='Model')],
                        outputs = [gr.outputs.Textbox(
                                                      label="Summary")],
                         
                        title = "Video Summary Generator",
                        examples = [
                                   ['https://www.youtube.com/watch?v=OaeYUm06in0&list=PLHgX2IExbFouJoqEr8JMF5MbZSbyC91-L&t=5761s', 'BART'],
                                   ['https://www.youtube.com/watch?v=U5OD8MjYnOM', 'BART'],
                                   ['https://www.youtube.com/watch?v=Gfr50f6ZBvo', 'BART'],
                                   ['https://www.youtube.com/watch?v=G4hL5Om4IJ4&t=2680s', 'BART'],
                                   ['https://www.youtube.com/watch?v=0Jd7fJgFkPU&t=8776s', 'mT5']
                                   ],
                        enable_queue=True)

interface.launch(debug=True)