RamAnanth1's picture
Update app.py
e0c2b71
raw
history blame
661 Bytes
import gradio as gr
import torch
import whisper
### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
title="Whisper to Emotion"
### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
whisper_model = whisper.load_model("small")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
record_input = gr.Audio(source="microphone",type="filepath", show_label=False)
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs=record_input, outputs="text")
iface.launch()