Add Cached Datasets
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import json
|
| 2 |
import gradio as gr
|
| 3 |
import pandas as pd
|
|
@@ -204,6 +205,18 @@ with BiasAware:
|
|
| 204 |
local_dataset = gr.File(
|
| 205 |
label="Dataset", file_types=["csv"], value=None, visible=True
|
| 206 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
hf_dataset = gr.Textbox(visible=False)
|
| 208 |
hf_dataset_search_results = gr.Radio(visible=False)
|
| 209 |
|
|
@@ -283,7 +296,7 @@ with BiasAware:
|
|
| 283 |
],
|
| 284 |
)
|
| 285 |
|
| 286 |
-
local_dataset.
|
| 287 |
fn=lambda _: gr.Button(
|
| 288 |
value=f"Load",
|
| 289 |
interactive=True,
|
|
|
|
| 1 |
+
import os
|
| 2 |
import json
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
|
|
|
| 205 |
local_dataset = gr.File(
|
| 206 |
label="Dataset", file_types=["csv"], value=None, visible=True
|
| 207 |
)
|
| 208 |
+
local_dataset_examples = gr.Examples(
|
| 209 |
+
examples=[
|
| 210 |
+
os.path.join(os.path.dirname(__file__), "data", filename)
|
| 211 |
+
for filename in os.listdir(
|
| 212 |
+
os.path.join(os.path.dirname(__file__), "data")
|
| 213 |
+
)
|
| 214 |
+
if filename.endswith(".csv")
|
| 215 |
+
],
|
| 216 |
+
inputs=local_dataset,
|
| 217 |
+
label="Local Examples",
|
| 218 |
+
)
|
| 219 |
+
|
| 220 |
hf_dataset = gr.Textbox(visible=False)
|
| 221 |
hf_dataset_search_results = gr.Radio(visible=False)
|
| 222 |
|
|
|
|
| 296 |
],
|
| 297 |
)
|
| 298 |
|
| 299 |
+
local_dataset.change(
|
| 300 |
fn=lambda _: gr.Button(
|
| 301 |
value=f"Load",
|
| 302 |
interactive=True,
|