mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-09 02:00:44 +08:00
2b0898b9a2
* 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>
26 lines
531 B
Python
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()
|