expose vertex ai and hf api base as env var

This commit is contained in:
Krrish Dholakia 2023-09-22 15:14:33 -07:00
parent 4f7a35cbef
commit 9ef0ad9e66
5 changed files with 31 additions and 6 deletions

View file

@ -49,6 +49,8 @@ def completion(
completion_url = api_base
elif "HF_API_BASE" in os.environ:
completion_url = os.getenv("HF_API_BASE", "")
elif "HUGGINGFACE_API_BASE" in os.environ:
completion_url = os.getenv("HUGGINGFACE_API_BASE", "")
else:
completion_url = f"https://api-inference.huggingface.co/models/{model}"