BruceWayne1 commited on
Commit
a7c9e60
·
1 Parent(s): d8c96b1
Files changed (1) hide show
  1. config.py +3 -1
config.py CHANGED
@@ -40,7 +40,9 @@ def get_server_config():
40
 
41
  def is_huggingface_spaces():
42
  """Check if running on Hugging Face Spaces"""
43
- return os.getenv("SPACE_ID") is not None
 
 
44
 
45
  def get_huggingface_url():
46
  """Get the Hugging Face Space URL"""
 
40
 
41
  def is_huggingface_spaces():
42
  """Check if running on Hugging Face Spaces"""
43
+ # Some Spaces builds may not expose SPACE_ID inside custom containers.
44
+ # Treat presence of PORT (the HF-assigned port) as indicator as well.
45
+ return os.getenv("SPACE_ID") is not None or os.getenv("PORT") is not None
46
 
47
  def get_huggingface_url():
48
  """Get the Hugging Face Space URL"""