Configuration
taxotagger
¶
ProjectConfig
¶
Bases: BaseModel
Configuration for the project.
Attributes:
-
mycoai_home
(str
) –The working directory for the project. Downloads and cache files are stored here. Defaults to
~/.cache/mycoai
.You can also set the
MYCOAI_HOME
environment variable to override this, e.g. on Linux or macOS:export MYCOAI_HOME="~/mycoai"
. -
device
(str
) –The device to run the model on. Defaults to
"cpu"
.Available options are:
"cpu"
: when no GPU is available,"cuda"
: when NVIDIA GPUs are available, use "cuda:0" to use the first GPU"mps"
: when Mac GPUs are available- and any other valid PyTorch device
For more information, see the PyTorch documentation.
-
force_reload
(bool
) –Whether to force reload the model. Defaults to
False
. -
log_level
(Literal['NONSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
) –The log level. Use the logging module's log level constants. Defaults to
"INFO"
. -
log_file
(str
) –The file to write the log to. If the file is an empty string (by default), the log will not be written to a file. If the file does not exist, it will be created. The log will be written to the file in append mode.
-
log_to_console
(bool
) –Whether to log to the console. Defaults to
True
.
Examples:
Get the default configuration
Set the working directory to "~/mycoai"
mycoai_home
class-attribute
instance-attribute
¶
mycoai_home: str = Field(
default_factory=lambda: expanduser(
getenv(ENV_MYCOAI_HOME, DEFAULT_CACHE_DIR)
),
min_length=1,
)
force_reload
class-attribute
instance-attribute
¶
force_reload: bool = Field(default=False, strict=True)