shravan / app.py
peb-peb's picture
add audio to text conversion
f78137c
raw
history blame
1.98 kB
import gradio as gr
from transcribe import transcribe
def main(audio_file, number_of_speakers):
# Audio to Text Converter
text_data = transcribe(audio_file, number_of_speakers)
print(text_data)
title = "ss"
short_summary = "dsa"
sentiment_analysis = "gyn"
quality = "dsdww"
detailed_summary = "jbjbjbjs"
return title, short_summary, sentiment_analysis, quality, detailed_summary
# UI Interface on the Hugging Face Page
with gr.Blocks() as demo:
with gr.Box():
with gr.Row():
with gr.Column():
audio_file = gr.File(label="Upload a Audio file (.wav)", file_count=1)
number_of_speakers = gr.Number(label="Number of Speakers", value=2)
with gr.Row():
btn_clear = gr.ClearButton(value="Clear", components=[audio_file, number_of_speakers])
btn_submit = gr.Button(value="Submit")
with gr.Column():
title = gr.Textbox(label="Title", placeholder="Title for Conversation")
short_summary = gr.Textbox(label="Short Summary", placeholder="Short Summary for Conversation")
sentiment_analysis = gr.Textbox(label="Sentiment Analysis", placeholder="Sentiment Analysis for Conversation")
quality = gr.Textbox(label="Quality of Conversation", placeholder="Quality of Conversation")
detailed_summary = gr.Textbox(label="Detailed Summary", placeholder="Detailed Summary for Conversation")
btn_submit.click(fn=main, inputs=[audio_file, number_of_speakers], outputs=[title, short_summary, sentiment_analysis, quality, detailed_summary])
gr.Markdown("## Examples")
gr.Examples(
examples=[
["./examples/sample4.wav", 2],
],
inputs=[audio_file, number_of_speakers],
outputs=[title, short_summary, sentiment_analysis, quality, detailed_summary],
fn=main,
)
gr.Markdown(
"""
See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)
for more details.
"""
)
demo.launch()