Skip to content

Commit

Permalink
update script live
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed Jan 7, 2024
1 parent 4ac20a0 commit 2de1f93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/infinity_emb/tests/script_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import requests # type: ignore
from sentence_transformers import SentenceTransformer # type: ignore

LIVE_URL = "http://localhost:7997/v1"
LIVE_URL = "http://localhost:7997"


def embedding_live_performance():
Expand All @@ -24,7 +24,7 @@ def embedding_live_performance():
model_name = req.json()["data"]["id"]
print(f"batch_size is {batch_size}, model={model_name}")
model = SentenceTransformer(model_name_or_path=model_name)

model.half()
def local(data: list[str], iters=1):
data_in = data * iters
enc = model.encode(data_in, batch_size=batch_size)
Expand Down Expand Up @@ -76,4 +76,4 @@ def _post(i):


if __name__ == "__main__":
latency_single()
embedding_live_performance()

0 comments on commit 2de1f93

Please sign in to comment.