Update apis/chat_api.py
Browse files- apis/chat_api.py +1 -1
apis/chat_api.py
CHANGED
@@ -175,7 +175,7 @@ class ChatAPIApp:
|
|
175 |
data_response = streamer.chat_return_dict(stream_response)
|
176 |
return data_response
|
177 |
|
178 |
-
|
179 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_name}"
|
180 |
headers = {"Authorization": f"Bearer {api_key}"}
|
181 |
response = requests.post(api_url, headers=headers, json={"inputs": texts})
|
|
|
175 |
data_response = streamer.chat_return_dict(stream_response)
|
176 |
return data_response
|
177 |
|
178 |
+
def chat_embedding(texts, model_name, api_key):
|
179 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_name}"
|
180 |
headers = {"Authorization": f"Bearer {api_key}"}
|
181 |
response = requests.post(api_url, headers=headers, json={"inputs": texts})
|