Skip to content

Commit

Permalink
fix dependcy + logg info (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotran2 authored Oct 8, 2024
1 parent 285aa14 commit e62c6e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion model_server/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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():
Expand Down
5 changes: 3 additions & 2 deletions model_server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions model_server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ openai==1.50.2
pandas
tf-keras
onnx==1.17.0
onnxruntime==1.19.2
pytest

0 comments on commit e62c6e7

Please sign in to comment.