Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,10 +45,10 @@ def clean_and_visualize(file, progress=gr.Progress()):
|
|
45 |
|
46 |
def launch_app():
|
47 |
with gr.Blocks() as app:
|
48 |
-
gr.Markdown("#
|
49 |
|
50 |
with gr.Row():
|
51 |
-
file_input = gr.File(label="Upload CSV File")
|
52 |
|
53 |
with gr.Row():
|
54 |
clean_button = gr.Button("Start Cleaning")
|
@@ -57,7 +57,7 @@ def launch_app():
|
|
57 |
progress_bar = gr.Progress()
|
58 |
|
59 |
with gr.Row():
|
60 |
-
|
61 |
|
62 |
with gr.Row():
|
63 |
output_gallery = gr.Gallery(label="Visualization Results", show_label=True, elem_id="gallery", columns=[2],
|
@@ -65,12 +65,12 @@ def launch_app():
|
|
65 |
|
66 |
def process_and_show_download(file):
|
67 |
cleaned_csv_path, image_files = clean_and_visualize(file, progress=progress_bar)
|
68 |
-
return gr.
|
69 |
|
70 |
clean_button.click(
|
71 |
fn=process_and_show_download,
|
72 |
inputs=file_input,
|
73 |
-
outputs=[
|
74 |
)
|
75 |
|
76 |
app.launch()
|
|
|
45 |
|
46 |
def launch_app():
|
47 |
with gr.Blocks() as app:
|
48 |
+
gr.Markdown("# Data Cleaning and Visualization App")
|
49 |
|
50 |
with gr.Row():
|
51 |
+
file_input = gr.File(label="Upload CSV File", file_count="single", file_types=[".csv"])
|
52 |
|
53 |
with gr.Row():
|
54 |
clean_button = gr.Button("Start Cleaning")
|
|
|
57 |
progress_bar = gr.Progress()
|
58 |
|
59 |
with gr.Row():
|
60 |
+
download_button = gr.DownloadButton(label="Download Cleaned CSV", visible=False)
|
61 |
|
62 |
with gr.Row():
|
63 |
output_gallery = gr.Gallery(label="Visualization Results", show_label=True, elem_id="gallery", columns=[2],
|
|
|
65 |
|
66 |
def process_and_show_download(file):
|
67 |
cleaned_csv_path, image_files = clean_and_visualize(file, progress=progress_bar)
|
68 |
+
return gr.DownloadButton.update(value=cleaned_csv_path, visible=True), image_files
|
69 |
|
70 |
clean_button.click(
|
71 |
fn=process_and_show_download,
|
72 |
inputs=file_input,
|
73 |
+
outputs=[download_button, output_gallery]
|
74 |
)
|
75 |
|
76 |
app.launch()
|