File size: 860 Bytes
1188681
23610b0
a1855ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23610b0
 
1188681
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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()