mama / app.py
Thong Nguyen
Upload file
c1b1966
raw
history blame
474 Bytes
import gradio as gr
import whisper
import tempfile
import os
model = whisper.load_model("base")
def video_to_text(video_file):
video_path = video_file.name
transcription = model.transcribe(video_path)
return transcription['text']
iface = gr.Interface(
fn=video_to_text,
inputs=gr.File(file_types=["video"]),
outputs="text",
title="Video to Text Transcription",
description="Upload a video and get the transcribed text"
)
iface.launch()