forked from phoenix/litellm-mirror
add support for keys
This commit is contained in:
parent
3f5e47e3ce
commit
e72836d181
10 changed files with 13 additions and 141 deletions
|
@ -22,7 +22,7 @@ class HuggingfaceRestAPILLM():
|
|||
"content-type": "application/json",
|
||||
}
|
||||
# get the api key if it exists in the environment or is passed in, but don't require it
|
||||
self.api_key = os.getenv("HF_TOKEN") if "HF_TOKEN" in os.environ else api_key
|
||||
self.api_key = api_key
|
||||
if self.api_key != None:
|
||||
self.headers["Authorization"] = f"Bearer {self.api_key}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue