ray-embedding 0.11.1__tar.gz → 0.11.2__tar.gz
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.
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/PKG-INFO +1 -1
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding/embedding_service.py +4 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding.egg-info/PKG-INFO +1 -1
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/setup.cfg +1 -1
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/README.md +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/pyproject.toml +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding/__init__.py +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding/deploy.py +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding/dto.py +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding/embedding_model.py +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding.egg-info/SOURCES.txt +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding.egg-info/dependency_links.txt +0 -0
- {ray_embedding-0.11.1 → ray_embedding-0.11.2}/ray_embedding.egg-info/top_level.txt +0 -0
|
@@ -34,6 +34,9 @@ class EmbeddingService:
|
|
|
34
34
|
|
|
35
35
|
# Resize the inputs into batch_size items, and dispatch in parallel
|
|
36
36
|
batches = [inputs[i:i+batch_size] for i in range(0, len(inputs), batch_size)]
|
|
37
|
+
if len(inputs) > batch_size:
|
|
38
|
+
self.logger.info(f"Original input is greater than {batch_size}. "
|
|
39
|
+
f"It was resized to {len(batches)} mini-batches of size {batch_size}")
|
|
37
40
|
tasks = [model_handle.remote(batch, dimensions) for batch in batches]
|
|
38
41
|
all_results = await asyncio.gather(*tasks, return_exceptions=True)
|
|
39
42
|
|
|
@@ -55,6 +58,7 @@ class EmbeddingService:
|
|
|
55
58
|
raise all_results[i]
|
|
56
59
|
|
|
57
60
|
# Flatten the results because all_results is a list of lists
|
|
61
|
+
self.logger.info(f"Successfully computed embeddings from {len(batches)} mini-batches")
|
|
58
62
|
return [emb for result in all_results for emb in result]
|
|
59
63
|
|
|
60
64
|
@web_api.post("/v1/embeddings", response_model=EmbeddingResponse)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|