Spaces:
Running
Running
Commit
·
a917486
1
Parent(s):
de8dd8a
handle long texts
Browse files
app.py
CHANGED
|
@@ -127,6 +127,11 @@ def build_html_output(s: str, style: str = "result_item_success"):
|
|
| 127 |
|
| 128 |
|
| 129 |
def process(language: str, repo_id: str, text: str, sid: str, speed: float):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
MyPrint(f"Input text: {text}. sid: {sid}, speed: {speed}")
|
| 131 |
sid = int(sid)
|
| 132 |
tts = get_pretrained_model(repo_id, speed)
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
def process(language: str, repo_id: str, text: str, sid: str, speed: float):
|
| 130 |
+
if len(text) > 1000:
|
| 131 |
+
raise ValueError(
|
| 132 |
+
"To ensure this space is responsive, please use short text for testing\n"
|
| 133 |
+
"You can run sherpa-onnx locally to process long texts."
|
| 134 |
+
)
|
| 135 |
MyPrint(f"Input text: {text}. sid: {sid}, speed: {speed}")
|
| 136 |
sid = int(sid)
|
| 137 |
tts = get_pretrained_model(repo_id, speed)
|