Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import io
|
|
|
|
| 2 |
import torch
|
| 3 |
import librosa
|
| 4 |
import requests
|
|
@@ -16,6 +17,7 @@ def load_audio_from_url(url):
|
|
| 16 |
return sample_rate, audio_data
|
| 17 |
return None, None
|
| 18 |
|
|
|
|
| 19 |
def synthesize_speech(text, ref_audio, ref_text):
|
| 20 |
if ref_audio is None or ref_text.strip() == "":
|
| 21 |
return "Error: Please provide a reference audio and its corresponding text."
|
|
|
|
| 1 |
import io
|
| 2 |
+
import spaces
|
| 3 |
import torch
|
| 4 |
import librosa
|
| 5 |
import requests
|
|
|
|
| 17 |
return sample_rate, audio_data
|
| 18 |
return None, None
|
| 19 |
|
| 20 |
+
@spaces.GPU
|
| 21 |
def synthesize_speech(text, ref_audio, ref_text):
|
| 22 |
if ref_audio is None or ref_text.strip() == "":
|
| 23 |
return "Error: Please provide a reference audio and its corresponding text."
|