Spaces:
Running
Running
Add Auth
Browse files
app.py
CHANGED
@@ -3,6 +3,15 @@ import gradio as gr
|
|
3 |
import sulkuPypi
|
4 |
from funciones import mass
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def perform(input1, input2):
|
7 |
|
8 |
#Primero que nada, checa cuantos tokens:
|
@@ -36,4 +45,5 @@ def perform(input1, input2):
|
|
36 |
demo = gr.Interface(
|
37 |
fn=perform, inputs=[gr.Image(), gr.Image()], outputs=[gr.Image()]
|
38 |
)
|
39 |
-
demo.launch()
|
|
|
|
3 |
import sulkuPypi
|
4 |
from funciones import mass
|
5 |
|
6 |
+
#Funciones adicionales
|
7 |
+
def authenticate(username, password):
|
8 |
+
usuarios = [("usuario1", "contraseña1"), ("usuario2", "contraseña2")]
|
9 |
+
for u, p in usuarios:
|
10 |
+
if username == u and password == p:
|
11 |
+
return True
|
12 |
+
return False
|
13 |
+
|
14 |
+
#Función principal
|
15 |
def perform(input1, input2):
|
16 |
|
17 |
#Primero que nada, checa cuantos tokens:
|
|
|
45 |
demo = gr.Interface(
|
46 |
fn=perform, inputs=[gr.Image(), gr.Image()], outputs=[gr.Image()]
|
47 |
)
|
48 |
+
#demo.launch()
|
49 |
+
demo.launch(auth=authenticate)
|