-
Notifications
You must be signed in to change notification settings - Fork 2
/
options.py
25 lines (17 loc) · 1.04 KB
/
options.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
import os
from codeproject_ai_sdk import ModuleOptions
class Options:
def __init__(self):
self._show_env_variables = True
self.app_dir = os.path.normpath(ModuleOptions.getEnvVariable("APPDIR", os.getcwd()))
self.models_dir = os.path.normpath(ModuleOptions.getEnvVariable("MODELS_DIR", f"{self.app_dir}/assets"))
self.sleep_time = 0.01
self.model_size = ModuleOptions.getEnvVariable("MODEL_SIZE", "Medium") # small, medium, large //, nano, x-large
self.use_CUDA = ModuleOptions.getEnvVariable("USE_CUDA", "True") # True / False
self.use_MPS = False # Default is False, but we'll enable if possible
# -------------------------------------------------------------------------
# dump the important variables
if self._show_env_variables:
print(f"Debug: APPDIR: {self.app_dir}")
print(f"Debug: MODEL_SIZE: {self.model_size}")
print(f"Debug: MODELS_DIR: {self.models_dir}")