Spaces:
Runtime error
Runtime error
Commit
•
7b69ae8
1
Parent(s):
03c9e14
Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,7 @@ MAX_IMAGES = 150
|
|
37 |
|
38 |
|
39 |
def load_captioning(uploaded_images, concept_sentence):
|
|
|
40 |
updates = []
|
41 |
if len(uploaded_images) <= 1:
|
42 |
raise gr.Error(
|
@@ -226,12 +227,10 @@ css = """
|
|
226 |
"""
|
227 |
|
228 |
def swap_visibilty(profile: Union[gr.OAuthProfile, None]):
|
229 |
-
print(profile)
|
230 |
if is_spaces:
|
231 |
if profile is None:
|
232 |
return gr.update(elem_classes=["main_ui_logged_out"])
|
233 |
else:
|
234 |
-
print(profile.name)
|
235 |
return gr.update(elem_classes=["main_ui_logged_in"])
|
236 |
else:
|
237 |
return gr.update(elem_classes=["main_ui_logged_in"])
|
@@ -384,5 +383,4 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
384 |
demo.load(fn=swap_visibilty, outputs=main_ui)
|
385 |
|
386 |
if __name__ == "__main__":
|
387 |
-
demo.
|
388 |
-
demo.launch(share=True)
|
|
|
37 |
|
38 |
|
39 |
def load_captioning(uploaded_images, concept_sentence):
|
40 |
+
gr.Info("Images uploaded!")
|
41 |
updates = []
|
42 |
if len(uploaded_images) <= 1:
|
43 |
raise gr.Error(
|
|
|
227 |
"""
|
228 |
|
229 |
def swap_visibilty(profile: Union[gr.OAuthProfile, None]):
|
|
|
230 |
if is_spaces:
|
231 |
if profile is None:
|
232 |
return gr.update(elem_classes=["main_ui_logged_out"])
|
233 |
else:
|
|
|
234 |
return gr.update(elem_classes=["main_ui_logged_in"])
|
235 |
else:
|
236 |
return gr.update(elem_classes=["main_ui_logged_in"])
|
|
|
383 |
demo.load(fn=swap_visibilty, outputs=main_ui)
|
384 |
|
385 |
if __name__ == "__main__":
|
386 |
+
demo.launch(share=True, show_error=True)
|
|