Spaces:
Sleeping
Sleeping
Nojoodalnahdi
commited on
Commit
•
e445db3
1
Parent(s):
5c49c73
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1 |
import gradio as gr
|
2 |
-
from
|
|
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
# Generate text based on the input prompt
|
9 |
-
results = generator(prompt, max_length=100, num_return_sequences=1)
|
10 |
-
return results[0]['generated_text']
|
11 |
-
|
12 |
-
# Create the Gradio interface
|
13 |
iface = gr.Interface(
|
14 |
-
fn=
|
15 |
-
inputs=
|
16 |
-
outputs=
|
17 |
-
title="
|
18 |
-
description="Enter
|
19 |
)
|
20 |
|
21 |
# Launch the interface
|
|
|
1 |
import gradio as gr
|
2 |
+
from gtts import gTTS
|
3 |
+
import os
|
4 |
|
5 |
+
def greet(name):
|
6 |
+
greeting_text = f"Hello, {name}! Welcome to our AI-powered voice greeting system."
|
7 |
+
tts = gTTS(text=greeting_text, lang='en')
|
8 |
+
tts.save("greeting.mp3")
|
9 |
+
return "greeting.mp3"
|
10 |
|
11 |
+
# Create Gradio interface
|
|
|
|
|
|
|
|
|
|
|
12 |
iface = gr.Interface(
|
13 |
+
fn=greet,
|
14 |
+
inputs="text",
|
15 |
+
outputs="audio",
|
16 |
+
title="AI Voice Greeting",
|
17 |
+
description="Enter your name and receive a personalized greeting as an AI-generated voice."
|
18 |
)
|
19 |
|
20 |
# Launch the interface
|