File size: 357 Bytes
a145e10
cdf59a1
a145e10
 
cdf59a1
a145e10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
PROMPT> IS_HUGGINGFACE_SPACES=true python -m src.huggingface_spaces.is_huggingface_spaces
True

PROMPT> python -m src.huggingface_spaces.is_huggingface_spaces
False
"""
import os

def is_huggingface_spaces() -> bool:
    return os.getenv("IS_HUGGINGFACE_SPACES", "false").lower() == "true"

if __name__ == "__main__":
    print(is_huggingface_spaces())