Moibe commited on
Commit
7e770bd
·
1 Parent(s): 4049f98

Access list

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,7 +1,20 @@
1
  import gradio as gr
2
 
 
 
 
 
 
 
 
 
 
 
3
  def greet(name):
4
  return "Hello, hola, aloha " + name + "!!"
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch(auth=("admin", "pass1234"))
 
 
 
 
1
  import gradio as gr
2
 
3
+ #Funciones adicionales
4
+
5
+ def authenticate(username, password):
6
+ usuarios = [("usuario1", "contraseña1"), ("usuario2", "contraseña2")]
7
+ for u, p in usuarios:
8
+ if username == u and password == p:
9
+ return True
10
+ return False
11
+
12
+ #Función principal
13
  def greet(name):
14
  return "Hello, hola, aloha " + name + "!!"
15
 
16
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
17
+
18
+ #iface.launch(auth=("admin", "pass1234"))
19
+
20
+ iface.launch(auth=authenticate)