gael1130 commited on
Commit
62de6c7
·
verified ·
1 Parent(s): 04f9a64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -18,6 +18,12 @@ from PIL import Image
18
  import plotly.graph_objects as go
19
  import pandas as pd
20
  import csv
 
 
 
 
 
 
21
 
22
  logged_in_user = None # Global state to store the logged-in user
23
 
@@ -219,4 +225,7 @@ with gr.Blocks(css="style.css", theme=gr.themes.Soft()) as app:
219
 
220
 
221
 
222
- app.launch(auth=auth_users, share=True)
 
 
 
 
18
  import plotly.graph_objects as go
19
  import pandas as pd
20
  import csv
21
+ import os
22
+
23
+ # Check if the app is running on Hugging Face Spaces
24
+ is_huggingface = "HF_SPACE" in os.environ
25
+
26
+
27
 
28
  logged_in_user = None # Global state to store the logged-in user
29
 
 
225
 
226
 
227
 
228
+ if is_huggingface:
229
+ app.launch() # No authentication for Hugging Face Spaces
230
+ else:
231
+ app.launch(auth=auth_users) # Use authentication locally or on private deployments