Update apis/chat_api.py
Browse files- apis/chat_api.py +2 -2
apis/chat_api.py
CHANGED
@@ -189,11 +189,11 @@ class ChatAPIApp:
|
|
189 |
return data_response
|
190 |
|
191 |
async def embedding(request: QueryRequest, api_key: str = Depends(extract_api_key)):
|
192 |
-
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{request.
|
193 |
headers = {"Authorization": f"Bearer {api_key}"}
|
194 |
|
195 |
try:
|
196 |
-
response = requests.post(api_url, headers=headers, json={"inputs": request.
|
197 |
result = response.json()
|
198 |
|
199 |
if "error" in result:
|
|
|
189 |
return data_response
|
190 |
|
191 |
async def embedding(request: QueryRequest, api_key: str = Depends(extract_api_key)):
|
192 |
+
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{request.model}"
|
193 |
headers = {"Authorization": f"Bearer {api_key}"}
|
194 |
|
195 |
try:
|
196 |
+
response = requests.post(api_url, headers=headers, json={"inputs": request.input})
|
197 |
result = response.json()
|
198 |
|
199 |
if "error" in result:
|