mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-01 11:45:36 +08:00
* fixed visibility error in notebooks in github * Delete fixNotebooks.py deleted script used to fix notebooks * Update generate_notebooks.py fixed a small bug that prevented visibility of notebooks in GitHub
1.1 KiB
1.1 KiB
Gradio Demo: zip_to_json¶
In [ ]:
!pip install -q gradio
In [ ]:
from zipfile import ZipFile import gradio as gr def zip_to_json(file_obj): files = [] with ZipFile(file_obj.name) as zfile: for zinfo in zfile.infolist(): files.append( { "name": zinfo.filename, "file_size": zinfo.file_size, "compressed_size": zinfo.compress_size, } ) return files demo = gr.Interface(zip_to_json, "file", "json") if __name__ == "__main__": demo.launch()