Spaces:
Sleeping
Sleeping
Commit
·
514fc19
1
Parent(s):
d0b115f
fixed my prior stupidity with making generated questions visible
Browse files
app.py
CHANGED
@@ -84,14 +84,19 @@ def generate_questions(
|
|
84 |
# After questions are generated, read the CSV file
|
85 |
csv_path = Path.cwd().joinpath("outputs/professor_guide.csv")
|
86 |
if csv_path.exists():
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
markdown
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
95 |
else:
|
96 |
return (markdown, button, button_2, gr.update(visible=False))
|
97 |
|
|
|
84 |
# After questions are generated, read the CSV file
|
85 |
csv_path = Path.cwd().joinpath("outputs/professor_guide.csv")
|
86 |
if csv_path.exists():
|
87 |
+
checkFrame = pd.read_csv(csv_path, usecols=[0], header=None)
|
88 |
+
checkFrame.columns = ["Check"]
|
89 |
+
if checkFrame.iloc[0]["Check"] != "Failed to generate more questions.":
|
90 |
+
# Generate markdown content
|
91 |
+
markdown_content = convert_csv_to_markdown(csv_path)
|
92 |
+
return (
|
93 |
+
markdown,
|
94 |
+
button,
|
95 |
+
button_2,
|
96 |
+
gr.update(value=markdown_content, visible=True)
|
97 |
+
)
|
98 |
+
else:
|
99 |
+
return (markdown, button, button_2, gr.update(visible=False))
|
100 |
else:
|
101 |
return (markdown, button, button_2, gr.update(visible=False))
|
102 |
|