Pijush2023 commited on
Commit
ec24331
·
verified ·
1 Parent(s): 1e22a37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -913,13 +913,11 @@ def update_images():
913
  # # Initialize database
914
  # initialize_database()
915
 
916
-
917
  # Google OAuth2 settings
918
  client_id = os.getenv("GOOGLE_CLIENT_ID")
919
  client_secret = os.getenv("GOOGLE_CLIENT_SECRET")
920
  authorization_base_url = 'https://accounts.google.com/o/oauth2/auth'
921
  token_url = 'https://accounts.google.com/o/oauth2/token'
922
- #redirect_uri = 'http://localhost:7860/callback'
923
  redirect_uri = 'https://huggingface.co/spaces/Pijush2023/omaha062028v3'
924
 
925
  scope = [
@@ -954,6 +952,7 @@ def create_gradio_interface():
954
 
955
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
956
  state = gr.State({'authenticated': False})
 
957
  if user_info:
958
  gr.Markdown(f"### Hello, {user_info['name']}! Welcome to the Gradio App")
959
  name = gr.Textbox(label="Enter your name")
@@ -989,10 +988,11 @@ def create_gradio_interface():
989
  image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
990
  refresh_button = gr.Button("Refresh Images")
991
  refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
 
992
  else:
993
  login_url = login()
994
- gr.Markdown(f"[Login with Google]({login_url})")
995
-
996
  return demo
997
 
998
  def main(params=None):
 
913
  # # Initialize database
914
  # initialize_database()
915
 
 
916
  # Google OAuth2 settings
917
  client_id = os.getenv("GOOGLE_CLIENT_ID")
918
  client_secret = os.getenv("GOOGLE_CLIENT_SECRET")
919
  authorization_base_url = 'https://accounts.google.com/o/oauth2/auth'
920
  token_url = 'https://accounts.google.com/o/oauth2/token'
 
921
  redirect_uri = 'https://huggingface.co/spaces/Pijush2023/omaha062028v3'
922
 
923
  scope = [
 
952
 
953
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
954
  state = gr.State({'authenticated': False})
955
+
956
  if user_info:
957
  gr.Markdown(f"### Hello, {user_info['name']}! Welcome to the Gradio App")
958
  name = gr.Textbox(label="Enter your name")
 
988
  image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
989
  refresh_button = gr.Button("Refresh Images")
990
  refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
991
+
992
  else:
993
  login_url = login()
994
+ gr.Markdown(f"<div style='text-align: right;'><a href='{login_url}' class='gr-button gr-button-primary'>Login with Google</a></div>")
995
+
996
  return demo
997
 
998
  def main(params=None):