Spaces:
Sleeping
Sleeping
add MAX_NUM_ROWS_TO_REWRITE
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ NAMESPACE = "dataset-rewriter"
|
|
29 |
URL = "https://huggingface.co/spaces/dataset-rewrite/dataset-rewrite"
|
30 |
|
31 |
NUM_ROWS_PREVIEW = 3
|
32 |
-
MAX_NUM_ROWS_TO_REWRITE = 1000
|
33 |
PARTIAL_SUFFIX = "-1k"
|
34 |
NUM_PARALLEL_CALLS = 10
|
35 |
NUM_ROWS_PER_CALL = 10
|
@@ -77,6 +77,9 @@ The dataset was generated using the [Dataset ReWriter]({url}) and {model_id} fro
|
|
77 |
"""
|
78 |
|
79 |
css = """
|
|
|
|
|
|
|
80 |
.settings {
|
81 |
background: transparent;
|
82 |
}
|
@@ -118,6 +121,7 @@ with gr.Blocks(css=css) as demo:
|
|
118 |
pretty_output_preview = gr.DataFrame(interactive=False)
|
119 |
full_dataset_generation_success_markdown = gr.Markdown("")
|
120 |
pretty_full_dataset_generation_output = gr.DataFrame(interactive=False, visible=False)
|
|
|
121 |
with gr.Column(scale=4, min_width="200px"):
|
122 |
with gr.Accordion("Settings", open=False, elem_classes="settings"):
|
123 |
gr.Markdown("Save datasets to your account")
|
@@ -125,6 +129,9 @@ with gr.Blocks(css=css) as demo:
|
|
125 |
select_namespace_dropdown = gr.Dropdown(choices=[NAMESPACE], value=NAMESPACE, label="Select user or organization", visible=False)
|
126 |
gr.Markdown("Save datasets as public or private datasets")
|
127 |
visibility_radio = gr.Radio(["public", "private"], value="public", container=False, interactive=False)
|
|
|
|
|
|
|
128 |
|
129 |
|
130 |
############
|
|
|
29 |
URL = "https://huggingface.co/spaces/dataset-rewrite/dataset-rewrite"
|
30 |
|
31 |
NUM_ROWS_PREVIEW = 3
|
32 |
+
MAX_NUM_ROWS_TO_REWRITE = int(os.environ.get("MAX_NUM_ROWS_TO_REWRITE") or 1000)
|
33 |
PARTIAL_SUFFIX = "-1k"
|
34 |
NUM_PARALLEL_CALLS = 10
|
35 |
NUM_ROWS_PER_CALL = 10
|
|
|
77 |
"""
|
78 |
|
79 |
css = """
|
80 |
+
a {
|
81 |
+
color: var(--body-text-color);
|
82 |
+
}
|
83 |
.settings {
|
84 |
background: transparent;
|
85 |
}
|
|
|
121 |
pretty_output_preview = gr.DataFrame(interactive=False)
|
122 |
full_dataset_generation_success_markdown = gr.Markdown("")
|
123 |
pretty_full_dataset_generation_output = gr.DataFrame(interactive=False, visible=False)
|
124 |
+
gr.Markdown(f"_powered by [{model_id}](https://huggingface.co/{model_id})_")
|
125 |
with gr.Column(scale=4, min_width="200px"):
|
126 |
with gr.Accordion("Settings", open=False, elem_classes="settings"):
|
127 |
gr.Markdown("Save datasets to your account")
|
|
|
129 |
select_namespace_dropdown = gr.Dropdown(choices=[NAMESPACE], value=NAMESPACE, label="Select user or organization", visible=False)
|
130 |
gr.Markdown("Save datasets as public or private datasets")
|
131 |
visibility_radio = gr.Radio(["public", "private"], value="public", container=False, interactive=False)
|
132 |
+
gr.Markdown("Maximum number of rows to ReWrite")
|
133 |
+
gr.Dropdown(choices=[MAX_NUM_ROWS_TO_REWRITE], value=MAX_NUM_ROWS_TO_REWRITE, interactive=False, container=False)
|
134 |
+
gr.Markdown(f"_[duplicate]({URL}?duplicate=true) this space to rewrite bigger datasets_")
|
135 |
|
136 |
|
137 |
############
|