Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -126,6 +126,11 @@ def simulate(image0, image1):
|
|
126 |
|
127 |
return preference, plt
|
128 |
|
|
|
|
|
|
|
|
|
|
|
129 |
subtitle = "Upload two images of emails and see which is generally preferred by Petco customers!"
|
130 |
|
131 |
demo = gr.Interface(fn=simulate,
|
@@ -138,4 +143,7 @@ demo = gr.Interface(fn=simulate,
|
|
138 |
)
|
139 |
|
140 |
if __name__ == "__main__":
|
141 |
-
demo.launch(
|
|
|
|
|
|
|
|
126 |
|
127 |
return preference, plt
|
128 |
|
129 |
+
# defines who can enter the application with the secrets that are set up
|
130 |
+
user_db = {
|
131 |
+
os.environ["username"]: os.environ["password"],
|
132 |
+
}
|
133 |
+
|
134 |
subtitle = "Upload two images of emails and see which is generally preferred by Petco customers!"
|
135 |
|
136 |
demo = gr.Interface(fn=simulate,
|
|
|
143 |
)
|
144 |
|
145 |
if __name__ == "__main__":
|
146 |
+
demo.launch(
|
147 |
+
auth=lambda u, p: user_db.get(u) == p,
|
148 |
+
auth_message="Welcome!"
|
149 |
+
)
|