Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -918,6 +918,7 @@ 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,10 +953,6 @@ def create_gradio_interface():
|
|
952 |
|
953 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
954 |
state = gr.State({'authenticated': False})
|
955 |
-
|
956 |
-
login_url = login()
|
957 |
-
gr.Markdown(f"<div style='text-align: right;'><a href='{login_url}' class='gr-button gr-button-primary'>Login with Google</a></div>")
|
958 |
-
|
959 |
if user_info:
|
960 |
gr.Markdown(f"### Hello, {user_info['name']}! Welcome to the Gradio App")
|
961 |
name = gr.Textbox(label="Enter your name")
|
@@ -991,7 +988,10 @@ def create_gradio_interface():
|
|
991 |
image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
|
992 |
refresh_button = gr.Button("Refresh Images")
|
993 |
refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
|
994 |
-
|
|
|
|
|
|
|
995 |
return demo
|
996 |
|
997 |
def main(params=None):
|
|
|
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 = 'http://localhost:7860/callback'
|
922 |
redirect_uri = 'https://huggingface.co/spaces/Pijush2023/omaha062028v3'
|
923 |
|
924 |
scope = [
|
|
|
953 |
|
954 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
955 |
state = gr.State({'authenticated': False})
|
|
|
|
|
|
|
|
|
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 |
+
else:
|
992 |
+
login_url = login()
|
993 |
+
gr.Markdown(f"[Login with Google]({login_url})")
|
994 |
+
|
995 |
return demo
|
996 |
|
997 |
def main(params=None):
|