mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
18 lines
355 B
Python
18 lines
355 B
Python
# Demo: (File, File) -> (File)
|
|
|
|
import gradio as gr
|
|
from zipfile import ZipFile
|
|
|
|
|
|
def zip_two_files(file1, file2):
|
|
with ZipFile('tmp.zip', 'w') as zipObj:
|
|
zipObj.write(file1.name, "file1")
|
|
zipObj.write(file2.name, "file2")
|
|
return "tmp.zip"
|
|
|
|
|
|
io = gr.Interface(zip_two_files, ["file", "file"], "file")
|
|
|
|
io.test_launch()
|
|
io.launch()
|