File size: 570 Bytes
e4f9cbe
 
 
 
 
 
 
 
 
b4ce410
e4f9cbe
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Load environment variables from .env file."""
import os
from typing import Optional

from dotenv import dotenv_values

CONFIG: dict[str, Optional[str]] = {
  **dotenv_values('.env'),  # load shared variables
  **dotenv_values('.env.local'),  # load locally set variables
  **dotenv_values('.env.demo'),  # load demo-specific environment flags.
  **os.environ,  # override loaded values with environment variables
}


def data_path() -> str:
  """Return the base path for data."""
  if CONFIG['LILAC_DATA_PATH']:
    return CONFIG['LILAC_DATA_PATH']
  return './data'