Skip to content

Commit

Permalink
load config files from .env file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
kdutia committed Feb 8, 2024
1 parent 91b2e4e commit 2f10bf8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ aws-error-utils = "^2.7.0"
moto = "^4.1.11"
torch = "2.0.0"
cpr-data-access = {git = "https://github.com/climatepolicyradar/data-access.git", tag = "0.4.0"}
python-dotenv = "^1.0.1"

[tool.poetry.dev-dependencies]
black = "^22.1.0"
Expand Down
3 changes: 3 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from typing import Set
import re
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

SBERT_MODEL: str = os.getenv("SBERT_MODEL", "msmarco-distilbert-dot-v5")
INDEX_ENCODER_CACHE_FOLDER: str = os.getenv("INDEX_ENCODER_CACHE_FOLDER", "/models")
Expand Down

0 comments on commit 2f10bf8

Please sign in to comment.