Spaces:
Paused
Paused
Download app.py from imseldrith/xunzipbot: direct link, hf CLI and curl.
- Browser
- Download file 705 Bytes
-
https://huggingface.co/spaces/imseldrith/xunzipbot/resolve/main/app.py
- Command line
-
hf download hf://spaces/imseldrith/xunzipbot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/imseldrith/xunzipbot/resolve/main/app.py
705 Bytes
| import gradio as gr | |
| import zipfile | |
| import os | |
| current_path = os.getcwd() | |
| print("Current path:", current_path) | |
| def unzip_file(zip_path, extract_path): | |
| with zipfile.ZipFile(zip_path, 'r') as zip_ref: | |
| zip_ref.extractall(extract_path) | |
| return "File successfully unzipped!" | |
| inputs = [ | |
| gr.Textbox(label="Zip file"), | |
| gr.inputs.Textbox(label="Extract path") | |
| ] | |
| outputs = gr.outputs.Textbox() | |
| title = "Zip file unzipping app" | |
| description = "This app unzips a zip file to the specified extract path." | |
| examples = [["unzip-bot-beta.zip", current_path+"/unzip"]] | |
| app = gr.Interface(unzip_file, inputs, outputs, title=title, description=description,examples=examples) | |
| app.launch(debug=True) | |