Spaces:
Sleeping
Sleeping
Commit
•
4b3e87c
1
Parent(s):
2c019ff
Update app.py
Browse files
app.py
CHANGED
@@ -129,7 +129,7 @@ def tts(
|
|
129 |
print(f"Model name: {model_name}")
|
130 |
print(f"F0: {f0_method}, Key: {f0_up_key}, Index: {index_rate}, Protect: {protect}")
|
131 |
try:
|
132 |
-
if limitation and len(tts_text) >
|
133 |
print("Error: Text too long")
|
134 |
return (
|
135 |
f"Text characters should be at most 280 in this huggingface space, but got {len(tts_text)} characters.",
|
@@ -151,10 +151,10 @@ def tts(
|
|
151 |
audio, sr = librosa.load(edge_output_filename, sr=16000, mono=True)
|
152 |
duration = len(audio) / sr
|
153 |
print(f"Audio duration: {duration}s")
|
154 |
-
if limitation and duration >=
|
155 |
print("Error: Audio too long")
|
156 |
return (
|
157 |
-
f"Audio should be less than
|
158 |
edge_output_filename,
|
159 |
None,
|
160 |
)
|
@@ -217,13 +217,11 @@ rmvpe_model = RMVPE("rmvpe.pt", config.is_half, config.device)
|
|
217 |
print("rmvpe model loaded.")
|
218 |
|
219 |
initial_md = """
|
220 |
-
#
|
221 |
-
|
222 |
-
Input text ➡[(edge-tts)](https://github.com/rany2/edge-tts)➡ Speech mp3 file ➡[(RVC)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)➡ Final output
|
223 |
|
224 |
This runs on the 🤗 server's cpu, so it may be slow.
|
225 |
|
226 |
-
Input characters are limited to
|
227 |
|
228 |
"""
|
229 |
|
|
|
129 |
print(f"Model name: {model_name}")
|
130 |
print(f"F0: {f0_method}, Key: {f0_up_key}, Index: {index_rate}, Protect: {protect}")
|
131 |
try:
|
132 |
+
if limitation and len(tts_text) > 1500:
|
133 |
print("Error: Text too long")
|
134 |
return (
|
135 |
f"Text characters should be at most 280 in this huggingface space, but got {len(tts_text)} characters.",
|
|
|
151 |
audio, sr = librosa.load(edge_output_filename, sr=16000, mono=True)
|
152 |
duration = len(audio) / sr
|
153 |
print(f"Audio duration: {duration}s")
|
154 |
+
if limitation and duration >= 100:
|
155 |
print("Error: Audio too long")
|
156 |
return (
|
157 |
+
f"Audio should be less than 100 seconds in space, but got {duration}s.",
|
158 |
edge_output_filename,
|
159 |
None,
|
160 |
)
|
|
|
217 |
print("rmvpe model loaded.")
|
218 |
|
219 |
initial_md = """
|
220 |
+
# OKIBA TTS Beta Testers
|
|
|
|
|
221 |
|
222 |
This runs on the 🤗 server's cpu, so it may be slow.
|
223 |
|
224 |
+
Input characters are limited to 1500 characters, and the speech audio is limited to 100 seconds in this 🤗 space.
|
225 |
|
226 |
"""
|
227 |
|