privateGPT/private_gpt/paths.py
Pablo Orgaz 022bd718e3
fix: Remove global state (#1216)
* Remove all global settings state

* chore: remove autogenerated class

* chore: cleanup

* chore: merge conflicts
2023-11-12 22:20:36 +01:00

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
)