Update main.py
Browse files
main.py
CHANGED
|
@@ -169,7 +169,7 @@ with gr.Blocks() as interface:
|
|
| 169 |
# or "stream=True" depending on your version of Gradio
|
| 170 |
)
|
| 171 |
|
| 172 |
-
def fluster_pipeline_dispatch(
|
| 173 |
user_input: str,
|
| 174 |
model_1: str,
|
| 175 |
model_2: str,
|
|
@@ -186,12 +186,16 @@ with gr.Blocks() as interface:
|
|
| 186 |
if not include_diagnosis:
|
| 187 |
# => run the original pipeline that yields 4 parallel flusters
|
| 188 |
# and do NOT parse/diagnose/fix anything.
|
| 189 |
-
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
else:
|
| 192 |
# => run only track0 & track2 (i.e. track 1 & track3 in the UI),
|
| 193 |
# parse them for 3 exercises each, diagnose, fix
|
| 194 |
-
return run_fluster_with_diagnosis(user_input, model_1, model_2)
|
| 195 |
|
| 196 |
|
| 197 |
write_fluster_button.click(
|
|
|
|
| 169 |
# or "stream=True" depending on your version of Gradio
|
| 170 |
)
|
| 171 |
|
| 172 |
+
async def fluster_pipeline_dispatch(
|
| 173 |
user_input: str,
|
| 174 |
model_1: str,
|
| 175 |
model_2: str,
|
|
|
|
| 186 |
if not include_diagnosis:
|
| 187 |
# => run the original pipeline that yields 4 parallel flusters
|
| 188 |
# and do NOT parse/diagnose/fix anything.
|
| 189 |
+
generator = run_fluster_no_diagnosis(user_input, model_1, model_2)
|
| 190 |
+
# Get the last result from the generator
|
| 191 |
+
final_results = ["", "", "", ""]
|
| 192 |
+
async for results in generator:
|
| 193 |
+
final_results = results
|
| 194 |
+
return (*final_results, "", "", "", "")
|
| 195 |
else:
|
| 196 |
# => run only track0 & track2 (i.e. track 1 & track3 in the UI),
|
| 197 |
# parse them for 3 exercises each, diagnose, fix
|
| 198 |
+
return await run_fluster_with_diagnosis(user_input, model_1, model_2)
|
| 199 |
|
| 200 |
|
| 201 |
write_fluster_button.click(
|