Spaces:
Running
Running
minor
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ def get_page(dataset: str, config: str, split: str, page: str) -> Tuple[str, int
|
|
106 |
|
107 |
|
108 |
with gr.Blocks() as demo:
|
109 |
-
gr.Markdown("# π
|
110 |
cp_dataset = gr.Textbox("squad", label="Pick a dataset", placeholder="squad")
|
111 |
cp_go = gr.Button("Explore")
|
112 |
cp_config = gr.Dropdown(["plain_text"], value="plain_text", label="Config", visible=False)
|
@@ -124,14 +124,14 @@ with gr.Blocks() as demo:
|
|
124 |
cp_info: gr.update(visible=False, value=""),
|
125 |
cp_result: gr.update(visible=False, value=""),
|
126 |
}
|
127 |
-
|
128 |
def show_dataset_at_config_and_split_and_page(dataset: str, config: str, split: str, page: str) -> dict:
|
129 |
try:
|
130 |
jsonl_result, max_page, info = get_page(dataset, config, split, page)
|
131 |
info = f"({info})" if info else ""
|
132 |
return {
|
133 |
cp_result: gr.update(visible=True, value=f"```json\n{jsonl_result}\n```"),
|
134 |
-
cp_info: gr.update(visible=True, value=f"Page {page}/{max_page}
|
135 |
cp_error: gr.update(visible=False, value="")
|
136 |
}
|
137 |
except AppError as err:
|
|
|
106 |
|
107 |
|
108 |
with gr.Blocks() as demo:
|
109 |
+
gr.Markdown("# π Datasets Explorer\n\nAccess any slice of data of any dataset on the [Hugging Face Dataset Hub](https://huggingface.co/datasets)")
|
110 |
cp_dataset = gr.Textbox("squad", label="Pick a dataset", placeholder="squad")
|
111 |
cp_go = gr.Button("Explore")
|
112 |
cp_config = gr.Dropdown(["plain_text"], value="plain_text", label="Config", visible=False)
|
|
|
124 |
cp_info: gr.update(visible=False, value=""),
|
125 |
cp_result: gr.update(visible=False, value=""),
|
126 |
}
|
127 |
+
|
128 |
def show_dataset_at_config_and_split_and_page(dataset: str, config: str, split: str, page: str) -> dict:
|
129 |
try:
|
130 |
jsonl_result, max_page, info = get_page(dataset, config, split, page)
|
131 |
info = f"({info})" if info else ""
|
132 |
return {
|
133 |
cp_result: gr.update(visible=True, value=f"```json\n{jsonl_result}\n```"),
|
134 |
+
cp_info: gr.update(visible=True, value=f"Page {page}/{max_page} {info}"),
|
135 |
cp_error: gr.update(visible=False, value="")
|
136 |
}
|
137 |
except AppError as err:
|