Spaces:
Runtime error
Runtime error
Commit
·
f36012f
1
Parent(s):
082b341
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from zipfile import ZipFile
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
|
6 |
+
def zip_two_files(file1, file2):
|
7 |
+
with ZipFile("tmp.zip", "w") as zipObj:
|
8 |
+
zipObj.write(file1.name, "file1")
|
9 |
+
zipObj.write(file2.name, "file2")
|
10 |
+
return "tmp.zip", "tmp.zip"
|
11 |
+
|
12 |
+
|
13 |
+
iface = gr.Interface(
|
14 |
+
zip_two_files,
|
15 |
+
["file", "file"],
|
16 |
+
["file", "file"],
|
17 |
+
examples=[
|
18 |
+
["files/titanic.csv", "files/titanic.csv"],
|
19 |
+
],
|
20 |
+
)
|
21 |
+
|
22 |
+
iface.launch()
|