DAMHelper / utils /env_utils.py
enricorampazzo's picture
now it should work. Refactored UI into smaller functions, added configurability for repository implementation and model
887083d
raw
history blame
746 Bytes
import os
import repository.repository
from repository.repository_abc import Model, ModelRoles
def in_hf() -> bool:
return os.getenv("env") == "hf"
def build_repo_from_environment(system_prompt: str):
implementation = os.getenv("implementation")
model_name = os.getenv("model_name")
if implementation:
return repository.repository.get_repository(implementation, Model(model_name, ModelRoles("system",
"user",
"assistant")),
system_prompt)
else:
return None