Spaces:
Running on Zero
Running on Zero
Commit ·
d708cc3
1
Parent(s): 8147f9a
:clown_face: revert sort of
Browse files- moral_compass_demo.py +9 -9
moral_compass_demo.py
CHANGED
|
@@ -99,16 +99,16 @@ def gradio_func(input_question, left_lang, right_lang):
|
|
| 99 |
"""
|
| 100 |
silly wrapper function for gradio that turns all inputs into a single func. runs both the LHS and RHS of teh 'app' in order to let gradio work correctly.
|
| 101 |
"""
|
| 102 |
-
with ThreadPoolExecutor(max_workers=3) as executor:
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
|
| 113 |
return output1, output2, output3
|
| 114 |
|
|
|
|
| 99 |
"""
|
| 100 |
silly wrapper function for gradio that turns all inputs into a single func. runs both the LHS and RHS of teh 'app' in order to let gradio work correctly.
|
| 101 |
"""
|
| 102 |
+
# with ThreadPoolExecutor(max_workers=3) as executor:
|
| 103 |
+
# # Submit all tasks simultaneously
|
| 104 |
+
# future1 = executor.submit(qwen_generate, input_question)
|
| 105 |
+
# future2 = executor.submit(llama_QA, input_question, llama2_pipe)
|
| 106 |
+
# future3 = executor.submit(llama_QA, input_question, llama3_pipe)
|
| 107 |
|
| 108 |
+
# Collect results
|
| 109 |
+
output1 = qwen_generate(input_question) #future1.result()
|
| 110 |
+
output2 = llama_QA(input_question, llama2_pipe) #future2.result()
|
| 111 |
+
output3 = llama_QA(input_question, llama3_pipe) #future3.result()
|
| 112 |
|
| 113 |
return output1, output2, output3
|
| 114 |
|