gradio/demo/zip_two_files/run.py
pngwn 2b0898b9a2
Scroll to output (#1077)
* implement loader + scroll into view

* changes

* refactor components to use Block inside the app

* cleanup

* cleanup

* implement all changes for all changes for all relevant components

* fix formatting

* demos

* add status tracker to every component

* fix tests

* fix unti test flake: randInt

* cleanup CI

* fix CI

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-04-26 15:48:39 +01:00

26 lines
531 B
Python

import os
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"
demo = gr.Interface(
zip_two_files,
["file", "file"],
"file",
examples=[
[os.path.join(os.path.dirname(__file__),"files/titanic.csv"),
os.path.join(os.path.dirname(__file__),"files/titanic.csv")],
],
)
if __name__ == "__main__":
demo.launch()