ray-embedding 0.9.9__py3-none-any.whl → 0.9.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ray-embedding might be problematic. Click here for more details.

@@ -76,18 +76,19 @@ class EmbeddingModel:
76
76
 
77
77
  @serve.batch(max_batch_size=8, batch_wait_timeout_s=0.25)
78
78
  async def __create_embeddings_batch(self, requests_batch: List[EmbeddingRequest]) -> List[EmbeddingResponse]:
79
- self_0 = self[0] if isinstance(self, list) else self
79
+ self_0 = self[0] if isinstance(self, list) else self # Ray also passes an array of self refs; just take the first one
80
+ embedding_model, matryoshka_dim, torch_device = self_0.embedding_model, self_0.matryoshka_dim, self_0.torch_device
80
81
 
81
82
  inputs, truncate_dims, num_inputs_list = [], [], []
82
83
  for request in requests_batch:
83
84
  input_text = request.input if isinstance(request.input, list) else [request.input] # Can be a list of texts
84
85
  inputs.extend(input_text)
85
86
  num_inputs_list.append(len(input_text))
86
- truncate_dims.append(request.dimensions or self_0.matryoshka_dim)
87
+ truncate_dims.append(request.dimensions or matryoshka_dim)
87
88
 
88
- embeddings = self_0.embedding_model.encode(
89
+ embeddings = embedding_model.encode(
89
90
  inputs, convert_to_tensor=True, normalize_embeddings=True, show_progress_bar=False,
90
- ).to(self_0.torch_device)
91
+ ).to(torch_device)
91
92
 
92
93
  model_name = requests_batch[0].model
93
94
  truncate_needed = any(dim is not None for dim in truncate_dims)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ray-embedding
3
- Version: 0.9.9
3
+ Version: 0.9.10
4
4
  Summary: Deploy SentenceTransformers embedding models to a ray cluster
5
5
  Author: Crispin Almodovar
6
6
  Author-email:
@@ -0,0 +1,8 @@
1
+ ray_embedding/__init__.py,sha256=OYJT0rVaaGzY613JqgfktsCgroDnBkGOHxR2FE9UtRU,49
2
+ ray_embedding/deploy.py,sha256=oqOhMxS5UyZ4oGhfpL7kqvrxLO8QW41sF_FHbNSJe-w,1858
3
+ ray_embedding/dto.py,sha256=e91ejZbM_NB9WTjF1YnfuV71cajYIh0vOX8oV_g2OwM,595
4
+ ray_embedding/embedding_model.py,sha256=DyhFO0kQnyoFq_VGJQYDEZKuvtwqhuXr83Vu23yb4ds,5966
5
+ ray_embedding-0.9.10.dist-info/METADATA,sha256=aDU4KlY1_-mtJ80tPb9FGGAnB9o2VSjQtsUR3Xt60_k,605
6
+ ray_embedding-0.9.10.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
7
+ ray_embedding-0.9.10.dist-info/top_level.txt,sha256=ziCblpJq1YsrryshFqxTRuRMgNuO1_tgvAAkGShATNA,14
8
+ ray_embedding-0.9.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- ray_embedding/__init__.py,sha256=OYJT0rVaaGzY613JqgfktsCgroDnBkGOHxR2FE9UtRU,49
2
- ray_embedding/deploy.py,sha256=oqOhMxS5UyZ4oGhfpL7kqvrxLO8QW41sF_FHbNSJe-w,1858
3
- ray_embedding/dto.py,sha256=e91ejZbM_NB9WTjF1YnfuV71cajYIh0vOX8oV_g2OwM,595
4
- ray_embedding/embedding_model.py,sha256=PBBuntLrJiwstD9AbD2n_ElU7rYZAYK0fMSESkMsFTU,5797
5
- ray_embedding-0.9.9.dist-info/METADATA,sha256=XRtQFNU7mhhSXFZF1YMyIII3zW9PfTXkiUN6AEHVAkA,604
6
- ray_embedding-0.9.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
- ray_embedding-0.9.9.dist-info/top_level.txt,sha256=ziCblpJq1YsrryshFqxTRuRMgNuO1_tgvAAkGShATNA,14
8
- ray_embedding-0.9.9.dist-info/RECORD,,