Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
# Load the text-to-audio model
|
| 5 |
-
tts = pipeline("
|
| 6 |
|
| 7 |
def text_to_audio(text):
|
| 8 |
output = tts(text)
|
|
@@ -10,9 +10,9 @@ def text_to_audio(text):
|
|
| 10 |
|
| 11 |
# Create Gradio interface
|
| 12 |
iface = gr.Interface(
|
| 13 |
-
fn=
|
| 14 |
inputs=gr.Textbox(label="Enter Text"),
|
| 15 |
-
outputs=
|
| 16 |
title="Text-to-Audio Chatbot",
|
| 17 |
description="Enter text, and get an AI-generated audio response."
|
| 18 |
)
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
# Load the text-to-audio model
|
| 5 |
+
tts = pipeline("create_music", model="facebook/musicgen-small")
|
| 6 |
|
| 7 |
def text_to_audio(text):
|
| 8 |
output = tts(text)
|
|
|
|
| 10 |
|
| 11 |
# Create Gradio interface
|
| 12 |
iface = gr.Interface(
|
| 13 |
+
fn=create_music,
|
| 14 |
inputs=gr.Textbox(label="Enter Text"),
|
| 15 |
+
outputs="audio"
|
| 16 |
title="Text-to-Audio Chatbot",
|
| 17 |
description="Enter text, and get an AI-generated audio response."
|
| 18 |
)
|