File size: 426 Bytes
08cc25a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

import gradio as gr
from inference import Inference


encoder_model_name='google/vit-large-patch32-224-in21k'
decoder_model_name='gpt2-large'
inference = Inference(
  decoder_model_name=decoder_model_name,
 
)

def generate_text(video):
  generated_text = inference.generate_text(video, encoder_model_name)

  return generated_text

app = gr.Interface(fn=generate_text, inputs='video', outputs='text')
app.launch(share=True)