Yehor commited on
Commit
6e8cd99
·
verified ·
1 Parent(s): 746ba6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 make the model, wait...")
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 the model.")
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 the model.")
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 the model.")
351
 
352
  gr.Success("Model created.")
353
 
@@ -458,7 +458,7 @@ with gr.Blocks(
458
  )
459
 
460
  do_quantize = gr.Checkbox(
461
- label="Quantize the model",
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