ArneBinder
commited on
https://github.com/ArneBinder/pie-document-level/pull/312 (gradio 5.5)
Browse files- src/demo/frontend_utils.py +0 -6
- src/start_demo.py +1 -2
src/demo/frontend_utils.py
CHANGED
@@ -4,12 +4,6 @@ import gradio as gr
|
|
4 |
import pandas as pd
|
5 |
|
6 |
|
7 |
-
# see https://github.com/gradio-app/gradio/issues/9288#issuecomment-2356163329
|
8 |
-
def get_fix_df_height_css(css_class: str, max_height: int) -> str:
|
9 |
-
# return ".qa-pairs .table-wrap {min-height: 170px; max-height: 170px;}"
|
10 |
-
return "." + css_class + " .table-wrap {max-height: " + str(max_height) + "px;}"
|
11 |
-
|
12 |
-
|
13 |
def escape_regex(regex: str) -> str:
|
14 |
# "double escape" the backslashes
|
15 |
result = regex.encode("unicode_escape").decode("utf-8")
|
|
|
4 |
import pandas as pd
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def escape_regex(regex: str) -> str:
|
8 |
# "double escape" the backslashes
|
9 |
result = regex.encode("unicode_escape").decode("utf-8")
|
src/start_demo.py
CHANGED
@@ -30,7 +30,6 @@ from src.demo.frontend_utils import (
|
|
30 |
change_tab,
|
31 |
escape_regex,
|
32 |
get_cell_for_fixed_column_from_df,
|
33 |
-
get_fix_df_height_css,
|
34 |
open_accordion,
|
35 |
unescape_regex,
|
36 |
)
|
@@ -111,7 +110,7 @@ def main(cfg: DictConfig) -> None:
|
|
111 |
default_retriever_config_str, device=default_device, config_format="yaml"
|
112 |
)
|
113 |
|
114 |
-
with gr.Blocks(
|
115 |
# wrap the pipeline and the embedding model/tokenizer in a tuple to avoid that it gets called
|
116 |
# models_state = gr.State((argumentation_model, embedding_model))
|
117 |
argumentation_model_state = gr.State((argumentation_model,))
|
|
|
30 |
change_tab,
|
31 |
escape_regex,
|
32 |
get_cell_for_fixed_column_from_df,
|
|
|
33 |
open_accordion,
|
34 |
unescape_regex,
|
35 |
)
|
|
|
110 |
default_retriever_config_str, device=default_device, config_format="yaml"
|
111 |
)
|
112 |
|
113 |
+
with gr.Blocks() as demo:
|
114 |
# wrap the pipeline and the embedding model/tokenizer in a tuple to avoid that it gets called
|
115 |
# models_state = gr.State((argumentation_model, embedding_model))
|
116 |
argumentation_model_state = gr.State((argumentation_model,))
|