Spaces:
Build error
Build error
LPhilp1943
commited on
Commit
•
792c625
1
Parent(s):
e0a55da
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def speech_to_text(input_audio_or_text):
|
|
34 |
def text_to_speech(text):
|
35 |
text = text.lower().translate(str.maketrans('', '', string.punctuation))
|
36 |
inputs = tts_tokenizer(text, return_tensors="pt")
|
37 |
-
inputs
|
38 |
with torch.no_grad():
|
39 |
output = tts_model(**inputs).waveform
|
40 |
waveform = output.numpy().squeeze()
|
@@ -59,4 +59,4 @@ iface = gr.Interface(
|
|
59 |
description="This app converts speech to text and then back to speech, ensuring the output audio is resampled to 16kHz."
|
60 |
)
|
61 |
|
62 |
-
iface.launch()
|
|
|
34 |
def text_to_speech(text):
|
35 |
text = text.lower().translate(str.maketrans('', '', string.punctuation))
|
36 |
inputs = tts_tokenizer(text, return_tensors="pt")
|
37 |
+
inputs['input_ids'] = inputs['input_ids'].long() # Corrected assignment for input_ids
|
38 |
with torch.no_grad():
|
39 |
output = tts_model(**inputs).waveform
|
40 |
waveform = output.numpy().squeeze()
|
|
|
59 |
description="This app converts speech to text and then back to speech, ensuring the output audio is resampled to 16kHz."
|
60 |
)
|
61 |
|
62 |
+
iface.launch(share=True) # Added `share=True` for creating a public link
|