mirror of
https://github.com/katanemo/plano.git
synced 2026-05-27 14:17:15 +02:00
fix dependcy + logg info (#148)
This commit is contained in:
parent
285aa1419b
commit
e62c6e75ea
3 changed files with 6 additions and 3 deletions
|
|
@ -59,6 +59,7 @@ async def models():
|
||||||
|
|
||||||
@app.post("/embeddings")
|
@app.post("/embeddings")
|
||||||
async def embedding(req: EmbeddingRequest, res: Response):
|
async def embedding(req: EmbeddingRequest, res: Response):
|
||||||
|
logger.info(f"Embedding req: {req}")
|
||||||
if req.model != transformers["model_name"]:
|
if req.model != transformers["model_name"]:
|
||||||
raise HTTPException(status_code=400, detail="unknown model: " + req.model)
|
raise HTTPException(status_code=400, detail="unknown model: " + req.model)
|
||||||
|
|
||||||
|
|
@ -70,7 +71,7 @@ async def embedding(req: EmbeddingRequest, res: Response):
|
||||||
embeddings = embeddings[0][:, 0]
|
embeddings = embeddings[0][:, 0]
|
||||||
# normalize embeddings
|
# normalize embeddings
|
||||||
embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1).detach().numpy()
|
embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1).detach().numpy()
|
||||||
print(f"Embedding Call Complete Time: {time.time()-start}")
|
logger.info(f"Embedding Call Complete Time: {time.time()-start}")
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
for embedding in embeddings.tolist():
|
for embedding in embeddings.tolist():
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,13 @@ pyyaml = "6.0.2"
|
||||||
accelerate = "*"
|
accelerate = "*"
|
||||||
psutil = "6.0.0"
|
psutil = "6.0.0"
|
||||||
optimum-intel = "*"
|
optimum-intel = "*"
|
||||||
openvino = "*"
|
openvino = "2024.4.0"
|
||||||
pandas = "*"
|
pandas = "*"
|
||||||
dateparser = "*"
|
dateparser = "*"
|
||||||
openai = "1.50.2"
|
openai = "1.50.2"
|
||||||
tf-keras = "*"
|
tf-keras = "*"
|
||||||
onnx = "*"
|
onnx = "1.17.0"
|
||||||
|
onnxruntime = "1.19.2"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
archgw_modelserver = "app:run_server"
|
archgw_modelserver = "app:run_server"
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,5 @@ openai==1.50.2
|
||||||
pandas
|
pandas
|
||||||
tf-keras
|
tf-keras
|
||||||
onnx==1.17.0
|
onnx==1.17.0
|
||||||
|
onnxruntime==1.19.2
|
||||||
pytest
|
pytest
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue