sanjeevbora commited on
Commit
bee02cd
·
verified ·
1 Parent(s): 1c7692e

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -49,14 +49,18 @@ def login():
49
 
50
  def check_login():
51
  return "You are logged in!" if access_token else "You are not logged in."
52
- @spaces.GPU(duration=60)
 
 
 
 
53
  def gradio_interface():
54
  with gr.Blocks() as demo:
55
  gr.Markdown("### Welcome to the App")
56
  btn_login = gr.Button("Login with Microsoft")
57
  output = gr.Textbox(label="Status")
58
 
59
- btn_login.click(lambda: (login(), check_login()), None, output)
60
 
61
  return demo
62
 
@@ -66,4 +70,4 @@ if __name__ == "__main__":
66
 
67
  # Launch Gradio app
68
  demo = gradio_interface()
69
- demo.launch()
 
49
 
50
  def check_login():
51
  return "You are logged in!" if access_token else "You are not logged in."
52
+
53
+ def handle_login_click():
54
+ login()
55
+ return check_login()
56
+
57
  def gradio_interface():
58
  with gr.Blocks() as demo:
59
  gr.Markdown("### Welcome to the App")
60
  btn_login = gr.Button("Login with Microsoft")
61
  output = gr.Textbox(label="Status")
62
 
63
+ btn_login.click(handle_login_click, None, output)
64
 
65
  return demo
66
 
 
70
 
71
  # Launch Gradio app
72
  demo = gradio_interface()
73
+ demo.launch()