Update app.py
Browse files
app.py
CHANGED
@@ -145,14 +145,21 @@ _CLASSES = [
|
|
145 |
# test
|
146 |
# l, im, f = main(*slider_defaults)
|
147 |
|
148 |
-
#load both datasets in memory? --> easier retrieval
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
meta_cats = {'dataset': ['rvl_cdip', 'rvl_cdip_N'],
|
151 |
'label': _CLASSES
|
152 |
}
|
153 |
sliders = [gr.Dropdown(choices=choices, value=choices[-1], label=label) for label, choices in meta_cats.items()]
|
154 |
-
slider_defaults = [
|
155 |
-
|
156 |
|
157 |
outputs = [
|
158 |
gr.Textbox(label="label"),
|
|
|
145 |
# test
|
146 |
# l, im, f = main(*slider_defaults)
|
147 |
|
148 |
+
#load both datasets in memory? --> easier retrieval afterwards with seed index based on pressing button
|
149 |
+
DATASETS = {
|
150 |
+
'rvl_cdip': load_dataset(
|
151 |
+
"bdpc/rvl_cdip_mp",
|
152 |
+
split="test"),
|
153 |
+
'rvl_cdip_N': load_dataset(
|
154 |
+
"bdpc/rvl_cdip_mp",
|
155 |
+
split="test")
|
156 |
+
}
|
157 |
|
158 |
meta_cats = {'dataset': ['rvl_cdip', 'rvl_cdip_N'],
|
159 |
'label': _CLASSES
|
160 |
}
|
161 |
sliders = [gr.Dropdown(choices=choices, value=choices[-1], label=label) for label, choices in meta_cats.items()]
|
162 |
+
slider_defaults = [slider.value for slider in sliders]
|
|
|
163 |
|
164 |
outputs = [
|
165 |
gr.Textbox(label="label"),
|