list-of-demos / constants.py
hysts's picture
hysts HF staff
Update
a307bc1
raw history blame
No virus
961 Bytes
from huggingface_hub import HfApi
STATUS_CHOICES = [
'RUNNING',
'PAUSED',
'STOPPED',
'RUNTIME_ERROR',
'BUILD_ERROR',
'CONFIG_ERROR',
'BUILDING',
'RUNNING_BUILDING',
'NO_APP_FILE',
]
HARDWARE_CHOICES = [
'cpu-basic',
'cpu-upgrade',
't4-small',
't4-medium',
'zero-a10g',
'a10g-small',
'a10g-large',
'a100-large',
]
SDK_CHOICES = [
'gradio',
'streamlit',
'docker',
]
SLEEP_TIME_INT_TO_STR = {
0: 'null',
300: '5 minutes',
900: '15 minutes',
1800: '30 minutes',
3600: '1 hour',
36000: '10 hours',
86400: '24 hours',
172800: '48 hours',
259200: '72 hours',
604800: '1 week',
}
SLEEP_TIME_CHOICES = list(SLEEP_TIME_INT_TO_STR.values())
SLEEP_TIME_STR_TO_INT = {v: k for k, v in SLEEP_TIME_INT_TO_STR.items()}
VISIBILITY_CHOICES = ['public', 'private']
api = HfApi()
WHOAMI = api.whoami()['name']
OWNER_CHOICES = [WHOAMI, 'other organizations']