Miquel Farré commited on
Commit
ffaa42f
·
1 Parent(s): 942117f
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -112,20 +112,25 @@ def join_waitlist(
112
  visible=True
113
  )
114
 
115
- def update_ui(profile: gr.OAuthProfile | None) -> Tuple[str, bool, bool]:
116
  """Update UI elements based on login status"""
117
  if profile is None:
118
  return (
119
- "## Please sign in with your Hugging Face account to join the waitlist.", # welcome message
120
- False, # hide join button
121
- False, # hide status message
 
 
 
122
  )
123
  return (
124
- f"## Welcome {profile.name} 👋 Click the button below 👇 to receive any updates related with the SmolVLM2 iPhone application", # welcome message
125
- True, # show join button
126
- True, # show status message
 
 
 
127
  )
128
-
129
  # Create the interface
130
  with gr.Blocks(title="SmolVLM2 Waitlist") as demo:
131
  gr.Markdown("""
 
112
  visible=True
113
  )
114
 
115
+ def update_ui(profile: gr.OAuthProfile | None) -> Tuple[gr.update, gr.update, gr.update]:
116
  """Update UI elements based on login status"""
117
  if profile is None:
118
  return (
119
+ gr.update(
120
+ value="## Please sign in with your Hugging Face account to join the waitlist.",
121
+ visible=True
122
+ ),
123
+ gr.update(visible=False),
124
+ gr.update(visible=False)
125
  )
126
  return (
127
+ gr.update(
128
+ value=f"## Welcome {profile.name} 👋 Click the button below 👇 to receive any updates related with the SmolVLM2 iPhone application",
129
+ visible=True
130
+ ),
131
+ gr.update(visible=True),
132
+ gr.update(visible=True)
133
  )
 
134
  # Create the interface
135
  with gr.Blocks(title="SmolVLM2 Waitlist") as demo:
136
  gr.Markdown("""