File size: 429 Bytes
a311a45
ad87ec6
a311a45
d71a37b
 
 
8a6f8f0
d71a37b
ad87ec6
 
a311a45
8a6f8f0
d71a37b
 
 
 
 
 
8a6f8f0
4f7f30a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import sys

import gradio as gr
from gradio.inputs import Textbox
from gradio.outputs import Textbox as TextOutput

def process(text):
    print('Hello')
    sys.stdout.flush()
    return f'Hi {text} (API_KEY: {os.environ.get("API_KEY")})'

interface = gr.Interface(
    fn=process,
    inputs=[Textbox()],
    outputs=[TextOutput()],
    theme='huggingface',
)

interface.launch(auth=[('a', 'b')], enable_queue=False)