Update apis/chat_api.py
Browse files- apis/chat_api.py +1 -1
apis/chat_api.py
CHANGED
@@ -187,7 +187,7 @@ class ChatAPIApp:
|
|
187 |
data_response = streamer.chat_return_dict(stream_response)
|
188 |
return data_response
|
189 |
|
190 |
-
async def chat_embedding(self, texts, model_name, api_key
|
191 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_name}"
|
192 |
headers = {"Authorization": f"Bearer {api_key}"}
|
193 |
response = requests.post(api_url, headers=headers, json={"inputs": texts})
|
|
|
187 |
data_response = streamer.chat_return_dict(stream_response)
|
188 |
return data_response
|
189 |
|
190 |
+
async def chat_embedding(self, texts, model_name, api_key: str = Depends(extract_api_key)):
|
191 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_name}"
|
192 |
headers = {"Authorization": f"Bearer {api_key}"}
|
193 |
response = requests.post(api_url, headers=headers, json={"inputs": texts})
|