Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -606,14 +606,21 @@ def synthandreturn(text):
|
|
606 |
pass
|
607 |
if model in AVAILABLE_MODELS.keys(): model = AVAILABLE_MODELS[model]
|
608 |
print(model)
|
|
|
609 |
result_storage[model] = result
|
610 |
# try:
|
611 |
# doloudnorm(result)
|
612 |
# except:
|
613 |
# pass
|
|
|
|
|
|
|
|
|
|
|
614 |
results = {}
|
615 |
-
|
616 |
-
|
|
|
617 |
|
618 |
thread1.start()
|
619 |
thread2.start()
|
@@ -629,12 +636,8 @@ def synthandreturn(text):
|
|
629 |
# print(sr)
|
630 |
#debug
|
631 |
# outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
632 |
-
mdl1k = mdl1
|
633 |
-
mdl2k = mdl2
|
634 |
-
print(mdl1k, mdl2k)
|
635 |
-
if mdl1 in AVAILABLE_MODELS.keys(): mdl1k=AVAILABLE_MODELS[mdl1]
|
636 |
-
if mdl2 in AVAILABLE_MODELS.keys(): mdl2k=AVAILABLE_MODELS[mdl2]
|
637 |
|
|
|
638 |
return (
|
639 |
text,
|
640 |
"Synthesize",
|
|
|
606 |
pass
|
607 |
if model in AVAILABLE_MODELS.keys(): model = AVAILABLE_MODELS[model]
|
608 |
print(model)
|
609 |
+
print(f"Running model {model}")
|
610 |
result_storage[model] = result
|
611 |
# try:
|
612 |
# doloudnorm(result)
|
613 |
# except:
|
614 |
# pass
|
615 |
+
mdl1k = mdl1
|
616 |
+
mdl2k = mdl2
|
617 |
+
print(mdl1k, mdl2k)
|
618 |
+
if mdl1 in AVAILABLE_MODELS.keys(): mdl1k=AVAILABLE_MODELS[mdl1]
|
619 |
+
if mdl2 in AVAILABLE_MODELS.keys(): mdl2k=AVAILABLE_MODELS[mdl2]
|
620 |
results = {}
|
621 |
+
print(f"Sending models {mdl1} and {mdl2} to API")
|
622 |
+
thread1 = threading.Thread(target=predict_and_update_result, args=(text, mdl1k, results))
|
623 |
+
thread2 = threading.Thread(target=predict_and_update_result, args=(text, mdl2k, results))
|
624 |
|
625 |
thread1.start()
|
626 |
thread2.start()
|
|
|
636 |
# print(sr)
|
637 |
#debug
|
638 |
# outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
|
|
|
|
|
|
|
|
|
|
639 |
|
640 |
+
print(f"Retrieving models {mdl1} and {mdl2} from API")
|
641 |
return (
|
642 |
text,
|
643 |
"Synthesize",
|