Fix cache error: return only string output, not module object
Browse files
app.py
CHANGED
|
@@ -302,10 +302,10 @@ exists and applies a fix to make the results fair.
|
|
| 302 |
with redirect_stdout(buf):
|
| 303 |
spec.loader.exec_module(m)
|
| 304 |
m.main()
|
| 305 |
-
return buf.getvalue()
|
| 306 |
|
| 307 |
with st.spinner("Running task2_segmentation.py..."):
|
| 308 |
-
t2_output
|
| 309 |
|
| 310 |
st.markdown("<div class='step-box'><span class='step-num'>2</span>"
|
| 311 |
"<b>Terminal output from task2_segmentation.py</b></div>",
|
|
@@ -372,10 +372,10 @@ how each algorithm explores the network step by step.
|
|
| 372 |
with redirect_stdout(buf):
|
| 373 |
spec.loader.exec_module(m)
|
| 374 |
m.main()
|
| 375 |
-
return buf.getvalue()
|
| 376 |
|
| 377 |
with st.spinner("Running task3_4_routing.py..."):
|
| 378 |
-
t3_output
|
| 379 |
|
| 380 |
st.markdown("<div class='step-box'><span class='step-num'>2</span>"
|
| 381 |
"<b>Terminal output from task3_4_routing.py</b></div>",
|
|
|
|
| 302 |
with redirect_stdout(buf):
|
| 303 |
spec.loader.exec_module(m)
|
| 304 |
m.main()
|
| 305 |
+
return buf.getvalue()
|
| 306 |
|
| 307 |
with st.spinner("Running task2_segmentation.py..."):
|
| 308 |
+
t2_output = _run_task2()
|
| 309 |
|
| 310 |
st.markdown("<div class='step-box'><span class='step-num'>2</span>"
|
| 311 |
"<b>Terminal output from task2_segmentation.py</b></div>",
|
|
|
|
| 372 |
with redirect_stdout(buf):
|
| 373 |
spec.loader.exec_module(m)
|
| 374 |
m.main()
|
| 375 |
+
return buf.getvalue()
|
| 376 |
|
| 377 |
with st.spinner("Running task3_4_routing.py..."):
|
| 378 |
+
t3_output = _run_task3()
|
| 379 |
|
| 380 |
st.markdown("<div class='step-box'><span class='step-num'>2</span>"
|
| 381 |
"<b>Terminal output from task3_4_routing.py</b></div>",
|