Spaces:
Running
Running
jonathanjordan21
commited on
Commit
•
3285336
1
Parent(s):
33e0d19
Update apis/chat_api.py
Browse files- apis/chat_api.py +1 -1
apis/chat_api.py
CHANGED
@@ -151,7 +151,7 @@ class ChatAPIApp:
|
|
151 |
try:
|
152 |
model = request.model
|
153 |
model_kwargs = request.options
|
154 |
-
embeddings =
|
155 |
return {"embedding": embeddings.tolist()}
|
156 |
except ValueError as e:
|
157 |
raise HTTPException(status_code=400, detail=str(e))
|
|
|
151 |
try:
|
152 |
model = request.model
|
153 |
model_kwargs = request.options
|
154 |
+
embeddings = self.embeddings[model].encode(request.prompt, convert_to_tensor=True)#, **model_kwargs)
|
155 |
return {"embedding": embeddings.tolist()}
|
156 |
except ValueError as e:
|
157 |
raise HTTPException(status_code=400, detail=str(e))
|