Update app.py
Browse files
app.py
CHANGED
@@ -242,7 +242,7 @@ def text_to_kenlm(
|
|
242 |
if not _order:
|
243 |
raise gr.Error("Please add an order.")
|
244 |
|
245 |
-
gr.Info("Started to
|
246 |
|
247 |
results = []
|
248 |
|
@@ -282,7 +282,7 @@ def text_to_kenlm(
|
|
282 |
r = subprocess.run(cmd, shell=True)
|
283 |
print(r)
|
284 |
if r.returncode != 0:
|
285 |
-
raise gr.Error("Failed to create
|
286 |
|
287 |
file_name_fixed = "/tmp/my_model_correct.arpa"
|
288 |
|
@@ -336,7 +336,7 @@ def text_to_kenlm(
|
|
336 |
r = subprocess.run(cmd, shell=True)
|
337 |
print(r)
|
338 |
if r.returncode != 0:
|
339 |
-
raise gr.Error("Failed to quantize
|
340 |
|
341 |
file_name = file_name_quantized
|
342 |
else:
|
@@ -347,7 +347,7 @@ def text_to_kenlm(
|
|
347 |
r = subprocess.run(cmd, shell=True)
|
348 |
print(r)
|
349 |
if r.returncode != 0:
|
350 |
-
raise gr.Error("Failed to quantize
|
351 |
|
352 |
gr.Success("Model created.")
|
353 |
|
@@ -458,7 +458,7 @@ with gr.Blocks(
|
|
458 |
)
|
459 |
|
460 |
do_quantize = gr.Checkbox(
|
461 |
-
label="Quantize
|
462 |
value=False,
|
463 |
)
|
464 |
|
|
|
242 |
if not _order:
|
243 |
raise gr.Error("Please add an order.")
|
244 |
|
245 |
+
gr.Info("Started to create a model, wait...")
|
246 |
|
247 |
results = []
|
248 |
|
|
|
282 |
r = subprocess.run(cmd, shell=True)
|
283 |
print(r)
|
284 |
if r.returncode != 0:
|
285 |
+
raise gr.Error("Failed to create model")
|
286 |
|
287 |
file_name_fixed = "/tmp/my_model_correct.arpa"
|
288 |
|
|
|
336 |
r = subprocess.run(cmd, shell=True)
|
337 |
print(r)
|
338 |
if r.returncode != 0:
|
339 |
+
raise gr.Error("Failed to quantize model")
|
340 |
|
341 |
file_name = file_name_quantized
|
342 |
else:
|
|
|
347 |
r = subprocess.run(cmd, shell=True)
|
348 |
print(r)
|
349 |
if r.returncode != 0:
|
350 |
+
raise gr.Error("Failed to quantize model")
|
351 |
|
352 |
gr.Success("Model created.")
|
353 |
|
|
|
458 |
)
|
459 |
|
460 |
do_quantize = gr.Checkbox(
|
461 |
+
label="Quantize model",
|
462 |
value=False,
|
463 |
)
|
464 |
|