fix env var loader (#143)

This commit is contained in:
Harrison Chase
2022-11-14 21:42:43 -08:00
committed by GitHub
parent 1835e8a681
commit a4b502d92f

View File

@@ -11,6 +11,6 @@ def enforce_stop_tokens(text: str, stop: List[str]) -> str:
def get_from_dict_or_env(data: Dict[str, Any], key: str, env_key: str) -> Any:
"""Get a value from a dictionary or an environment variable."""
if key in data:
if key in data and data[key]:
return data[key]
return os.environ.get(env_key, None)