Vishaltiwari2019's picture
Update app.py
a1855ac verified
raw
history blame
860 Bytes
import gradio as gr
# Text to Speech Interface
tts_title = "Text to Speech Translation"
tts_examples = [
"I love learning machine learning",
"How do you do?",
]
tts_demo = gr.Interface.load(
"huggingface/facebook/fastspeech2-en-ljspeech",
title=tts_title,
examples=tts_examples,
description="Give me something to say!",
)
# Sentiment Analysis Interface
sentiment_title = "Sentiment Analysis"
sentiment_examples = [
"I love learning machine learning",
"How do you do?",
]
sentiment_demo = gr.Interface.load(
"huggingface/nlp-sentiment-analysis",
title=sentiment_title,
examples=sentiment_examples,
description="Analyze the sentiment of the text!",
)
# Tabbed Interface
demo = gr.TabbedInterface([tts_demo, sentiment_demo], ["Text to Speech", "Sentiment Analysis"])
if __name__ == "__main__":
demo.launch()