mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
cc0cff893f
- black formatting - isort formatting
24 lines
433 B
Python
24 lines
433 B
Python
from zipfile import ZipFile
|
|
|
|
import gradio as gr
|
|
|
|
|
|
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"
|
|
|
|
|
|
iface = gr.Interface(
|
|
zip_two_files,
|
|
["file", "file"],
|
|
"file",
|
|
examples=[
|
|
["files/titanic.csv", "files/titanic.csv"],
|
|
],
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
iface.launch()
|