File size: 486 Bytes
120ba68
2303553
120ba68
2303553
2c4e182
2303553
 
 
 
120ba68
2303553
120ba68
2303553
 
 
120ba68
 
 
2303553
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import avaimet

def authenticate(username, password):
    usuarios = [("usuario1", "contrasena1"), ("usuario2", "contrasena2")]
    for u, p in usuarios:
        if username == u and password == p:
            return True
    return False

def greet(user):
    
    tokens = avaimet.do()
    
    return "User: " + user + tokens + "!!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")

#iface.launch()
iface.launch(auth=authenticate)