Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
|
@@ -107,6 +107,7 @@ def submit(grammar, coherence, state):
|
|
| 107 |
update_dataset(state)
|
| 108 |
|
| 109 |
return navigate("next", state)
|
|
|
|
| 110 |
with gr.Blocks() as app:
|
| 111 |
state = gr.State(load_data())
|
| 112 |
|
|
@@ -114,9 +115,9 @@ with gr.Blocks() as app:
|
|
| 114 |
|
| 115 |
with gr.Row():
|
| 116 |
# Sidebar Column
|
| 117 |
-
with gr.Column(scale=1, min_width=200):
|
| 118 |
gr.Markdown("### Navigation")
|
| 119 |
-
with gr.Column(
|
| 120 |
annotated_btn = gr.Button("Annotated", variant="primary")
|
| 121 |
unannotated_btn = gr.Button("Unannotated", variant="primary")
|
| 122 |
gr.Markdown("---")
|
|
@@ -178,6 +179,21 @@ with gr.Blocks() as app:
|
|
| 178 |
outputs=navigation_outputs
|
| 179 |
)
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
if __name__ == "__main__":
|
| 183 |
app.launch(share=True)
|
|
|
|
| 107 |
update_dataset(state)
|
| 108 |
|
| 109 |
return navigate("next", state)
|
| 110 |
+
|
| 111 |
with gr.Blocks() as app:
|
| 112 |
state = gr.State(load_data())
|
| 113 |
|
|
|
|
| 115 |
|
| 116 |
with gr.Row():
|
| 117 |
# Sidebar Column
|
| 118 |
+
with gr.Column(scale=1, min_width=200, elem_classes="sidebar"):
|
| 119 |
gr.Markdown("### Navigation")
|
| 120 |
+
with gr.Column(elem_classes="nav-buttons"):
|
| 121 |
annotated_btn = gr.Button("Annotated", variant="primary")
|
| 122 |
unannotated_btn = gr.Button("Unannotated", variant="primary")
|
| 123 |
gr.Markdown("---")
|
|
|
|
| 179 |
outputs=navigation_outputs
|
| 180 |
)
|
| 181 |
|
| 182 |
+
# Add custom CSS
|
| 183 |
+
app.css = """
|
| 184 |
+
.sidebar {
|
| 185 |
+
background: #f8f9fa;
|
| 186 |
+
padding: 20px;
|
| 187 |
+
border-right: 1px solid #dee2e6;
|
| 188 |
+
height: 100vh;
|
| 189 |
+
}
|
| 190 |
+
.nav-buttons {
|
| 191 |
+
background: #f0f0f0;
|
| 192 |
+
padding: 20px;
|
| 193 |
+
border-radius: 10px;
|
| 194 |
+
}
|
| 195 |
+
"""
|
| 196 |
+
|
| 197 |
|
| 198 |
if __name__ == "__main__":
|
| 199 |
app.launch(share=True)
|