File size: 392 Bytes
e451900
 
 
c92a2d4
e451900
 
f8d4393
e451900
 
 
 
4b5fdf7
 
e451900
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr

def func(file_obj) -> str:
    return file_obj

def auth(username: str, passwd: str) -> bool:
    return username == "tom" and passwd == "tom"

def main():
    demo = gr.Interface(
        fn=func,
        inputs=[gr.File()],
        outputs=[gr.File()],
    )
    demo.queue(api_open=True)
    demo.launch(
        auth=auth,
    )

if __name__ == "__main__":
    main()