-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Globals.py
33 lines (30 loc) · 994 Bytes
/
Globals.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
from dotenv import load_dotenv
load_dotenv()
def getenv(var_name: str):
default_values = {
"EZLOCALAI_URL": "http://localhost:8091",
"EZLOCALAI_API_KEY": "none",
"ALLOWED_DOMAINS": "*",
"DEFAULT_MODEL": "TheBloke/phi-2-dpo-GGUF",
"WHISPER_MODEL": "base.en",
"VISION_MODEL": "",
"SD_MODEL": "",
"EMBEDDING_ENABLED": "true",
"IMG_ENABLED": "false",
"TTS_ENABLED": "true",
"STT_ENABLED": "true",
"IMG_DEVICE": "cpu",
"NGROK_TOKEN": "",
"LOG_LEVEL": "INFO",
"LOG_FORMAT": "%(asctime)s | %(levelname)s | %(message)s",
"UVICORN_WORKERS": 10,
"GPU_LAYERS": "0",
"MAIN_GPU": "0",
"TENSOR_SPLIT": "",
"QUANT_TYPE": "Q4_K_M",
"LLM_MAX_TOKENS": "2048",
"LLM_BATCH_SIZE": "16",
}
default_value = default_values[var_name] if var_name in default_values else ""
return os.getenv(var_name, default_value)