Ray0202 commited on
Commit ·
331910c
1
Parent(s): 622891d
update
Browse files
app.py
CHANGED
|
@@ -139,7 +139,7 @@ def save_submission(uploaded_file) -> str:
|
|
| 139 |
return f"Submission received for review. Saved to `{out_path}`."
|
| 140 |
|
| 141 |
|
| 142 |
-
def
|
| 143 |
try:
|
| 144 |
records = load_records(RESULTS_PATH)
|
| 145 |
if not records:
|
|
@@ -150,7 +150,10 @@ def example_record_markdown() -> str:
|
|
| 150 |
return f"Could not load example record: {exc}"
|
| 151 |
|
| 152 |
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
| 154 |
with demo:
|
| 155 |
gr.HTML(TITLE)
|
| 156 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
|
@@ -170,7 +173,7 @@ with demo:
|
|
| 170 |
"Upload a results file for manual review. Approved results will be merged into the main dataset.",
|
| 171 |
elem_classes="markdown-text",
|
| 172 |
)
|
| 173 |
-
gr.Markdown(
|
| 174 |
submission_file = gr.File(label="Results file (.json or .csv)", file_types=[".json", ".csv"])
|
| 175 |
submit_button = gr.Button("Submit for Review")
|
| 176 |
submission_status = gr.Markdown()
|
|
|
|
| 139 |
return f"Submission received for review. Saved to `{out_path}`."
|
| 140 |
|
| 141 |
|
| 142 |
+
def build_example_record_markdown() -> str:
|
| 143 |
try:
|
| 144 |
records = load_records(RESULTS_PATH)
|
| 145 |
if not records:
|
|
|
|
| 150 |
return f"Could not load example record: {exc}"
|
| 151 |
|
| 152 |
|
| 153 |
+
EXAMPLE_RECORD_MD = build_example_record_markdown()
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
demo = gr.Blocks(css=custom_css, analytics_enabled=False)
|
| 157 |
with demo:
|
| 158 |
gr.HTML(TITLE)
|
| 159 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
|
|
|
| 173 |
"Upload a results file for manual review. Approved results will be merged into the main dataset.",
|
| 174 |
elem_classes="markdown-text",
|
| 175 |
)
|
| 176 |
+
gr.Markdown(EXAMPLE_RECORD_MD, elem_classes="markdown-text")
|
| 177 |
submission_file = gr.File(label="Results file (.json or .csv)", file_types=[".json", ".csv"])
|
| 178 |
submit_button = gr.Button("Submit for Review")
|
| 179 |
submission_status = gr.Markdown()
|