Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def infer(
|
|
18 |
num_inference_steps,
|
19 |
user_info,
|
20 |
):
|
21 |
-
if not user_info or not user_info
|
22 |
return "Please log in to generate images.", None
|
23 |
|
24 |
# Load the pipeline only when this function is called
|
@@ -68,6 +68,8 @@ with gr.Blocks(css=css) as demo:
|
|
68 |
user_info = gr.State()
|
69 |
|
70 |
def update_user_info(profile):
|
|
|
|
|
71 |
return profile
|
72 |
|
73 |
login_button.click(
|
|
|
18 |
num_inference_steps,
|
19 |
user_info,
|
20 |
):
|
21 |
+
if not user_info or "username" not in user_info:
|
22 |
return "Please log in to generate images.", None
|
23 |
|
24 |
# Load the pipeline only when this function is called
|
|
|
68 |
user_info = gr.State()
|
69 |
|
70 |
def update_user_info(profile):
|
71 |
+
if profile is None:
|
72 |
+
return "No user information available"
|
73 |
return profile
|
74 |
|
75 |
login_button.click(
|