959a391334
Some checks failed
publish docs / publish-docs (push) Has been cancelled
release-please / release-please (push) Has been cancelled
tests / setup (push) Has been cancelled
tests / ${{ matrix.quality-command }} (black) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (mypy) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (ruff) (push) Has been cancelled
tests / test (push) Has been cancelled
tests / all_checks_passed (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
19 lines
517 B
Python
19 lines
517 B
Python
from pathlib import Path
|
|
|
|
from private_gpt.constants import PROJECT_ROOT_PATH
|
|
from private_gpt.settings.settings import settings
|
|
|
|
|
|
def _absolute_or_from_project_root(path: str) -> Path:
|
|
if path.startswith("/"):
|
|
return Path(path)
|
|
return PROJECT_ROOT_PATH / path
|
|
|
|
|
|
models_path: Path = PROJECT_ROOT_PATH / "models"
|
|
models_cache_path: Path = models_path / "cache"
|
|
docs_path: Path = PROJECT_ROOT_PATH / "docs"
|
|
local_data_path: Path = _absolute_or_from_project_root(
|
|
settings().data.local_data_folder
|
|
)
|