fix dependcy + logg info (#148)

This commit is contained in:
Co Tran 2024-10-08 16:42:40 -07:00 committed by GitHub
parent 285aa1419b
commit e62c6e75ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -59,6 +59,7 @@ async def models():
@app.post("/embeddings")
async def embedding(req: EmbeddingRequest, res: Response):
logger.info(f"Embedding req: {req}")
if req.model != transformers["model_name"]:
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]
# normalize embeddings
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 = []
for embedding in embeddings.tolist():

View file

@ -22,12 +22,13 @@ pyyaml = "6.0.2"
accelerate = "*"
psutil = "6.0.0"
optimum-intel = "*"
openvino = "*"
openvino = "2024.4.0"
pandas = "*"
dateparser = "*"
openai = "1.50.2"
tf-keras = "*"
onnx = "*"
onnx = "1.17.0"
onnxruntime = "1.19.2"
[tool.poetry.scripts]
archgw_modelserver = "app:run_server"

View file

@ -16,4 +16,5 @@ openai==1.50.2
pandas
tf-keras
onnx==1.17.0
onnxruntime==1.19.2
pytest