Spaces:
Sleeping
Sleeping
File size: 705 Bytes
412752b 561fe8a 412752b 5ac4030 412752b 561fe8a 412752b ae126d2 412752b b927939 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
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)
|