Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
-
import soundfile as sf
|
4 |
import torch
|
5 |
from transformers import pipeline
|
|
|
6 |
|
7 |
# Set up your TTS model (as before)
|
8 |
synthesiser = pipeline("text-to-speech", "Futuresony/output")
|
@@ -49,11 +49,8 @@ def respond(
|
|
49 |
# Generate speech from the text response
|
50 |
speech = synthesiser(response, forward_params={"speaker_embeddings": speaker_embedding})
|
51 |
|
52 |
-
#
|
53 |
-
|
54 |
-
|
55 |
-
return response, "generated_speech.wav"
|
56 |
-
# You can return the text along with speech if needed
|
57 |
|
58 |
|
59 |
# Create the Gradio interface
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
|
|
3 |
import torch
|
4 |
from transformers import pipeline
|
5 |
+
from datasets import load_dataset
|
6 |
|
7 |
# Set up your TTS model (as before)
|
8 |
synthesiser = pipeline("text-to-speech", "Futuresony/output")
|
|
|
49 |
# Generate speech from the text response
|
50 |
speech = synthesiser(response, forward_params={"speaker_embeddings": speaker_embedding})
|
51 |
|
52 |
+
# Return the audio as a Gradio audio component
|
53 |
+
return response, speech["audio"]
|
|
|
|
|
|
|
54 |
|
55 |
|
56 |
# Create the Gradio interface
|