Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
"""GLiFormer Gradio Demo — Multi-task Information Extraction
|
| 2 |
|
| 3 |
-
Run it with `python
|
| 4 |
|
| 5 |
Everything the demo needs lives in this one file, in three sections: the
|
| 6 |
**Metrics** that score a prediction against a gold annotation, the
|
|
@@ -3516,7 +3516,7 @@ def create_label_group_manager(
|
|
| 3516 |
datatype=["number", "str", "str"] if not extra_fields else ["number", "str", "str", "str"],
|
| 3517 |
label="Groups",
|
| 3518 |
interactive=False,
|
| 3519 |
-
|
| 3520 |
)
|
| 3521 |
|
| 3522 |
with gr.Row():
|
|
@@ -4651,7 +4651,6 @@ def create_gold_view(example: dict) -> gr.Code:
|
|
| 4651 |
|
| 4652 |
with gr.Blocks(
|
| 4653 |
title="GLiFormer Demo",
|
| 4654 |
-
theme=gr.themes.Soft(),
|
| 4655 |
) as demo:
|
| 4656 |
gr.Markdown(
|
| 4657 |
"""
|
|
@@ -5163,4 +5162,9 @@ with gr.Blocks(
|
|
| 5163 |
demo.queue()
|
| 5164 |
|
| 5165 |
if __name__ == "__main__":
|
| 5166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""GLiFormer Gradio Demo — Multi-task Information Extraction
|
| 2 |
|
| 3 |
+
Run it with `python app.py`; point it at a checkpoint with `GLIFORMER_MODEL_ID`.
|
| 4 |
|
| 5 |
Everything the demo needs lives in this one file, in three sections: the
|
| 6 |
**Metrics** that score a prediction against a gold annotation, the
|
|
|
|
| 3516 |
datatype=["number", "str", "str"] if not extra_fields else ["number", "str", "str", "str"],
|
| 3517 |
label="Groups",
|
| 3518 |
interactive=False,
|
| 3519 |
+
column_count=3 if not extra_fields else 4,
|
| 3520 |
)
|
| 3521 |
|
| 3522 |
with gr.Row():
|
|
|
|
| 4651 |
|
| 4652 |
with gr.Blocks(
|
| 4653 |
title="GLiFormer Demo",
|
|
|
|
| 4654 |
) as demo:
|
| 4655 |
gr.Markdown(
|
| 4656 |
"""
|
|
|
|
| 5162 |
demo.queue()
|
| 5163 |
|
| 5164 |
if __name__ == "__main__":
|
| 5165 |
+
# Serve directly from Python, avoiding the Node SSR proxy on Spaces.
|
| 5166 |
+
demo.launch(
|
| 5167 |
+
debug=True,
|
| 5168 |
+
theme=gr.themes.Soft(),
|
| 5169 |
+
ssr_mode=False,
|
| 5170 |
+
)
|