fix env var loader (#143)

pull/144/head
Harrison Chase 2 years ago committed by GitHub
parent 1835e8a681
commit a4b502d92f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save