ray-embedding 0.10.12__tar.gz → 0.10.15__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.10.12 → ray_embedding-0.10.15}/PKG-INFO +1 -1
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding/embedding_model.py +7 -2
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding.egg-info/PKG-INFO +1 -1
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/setup.cfg +1 -1
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/README.md +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/pyproject.toml +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding/__init__.py +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding/deploy.py +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding/dto.py +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding.egg-info/SOURCES.txt +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding.egg-info/dependency_links.txt +0 -0
- {ray_embedding-0.10.12 → ray_embedding-0.10.15}/ray_embedding.egg-info/top_level.txt +0 -0
|
@@ -7,6 +7,7 @@ import torch
|
|
|
7
7
|
from fastapi import FastAPI, HTTPException
|
|
8
8
|
from ray import serve
|
|
9
9
|
from sentence_transformers import SentenceTransformer
|
|
10
|
+
from pynvml import nvmlInit, nvmlDeviceGetCount
|
|
10
11
|
|
|
11
12
|
from ray_embedding.dto import EmbeddingResponse, EmbeddingRequest
|
|
12
13
|
|
|
@@ -106,8 +107,12 @@ class EmbeddingModel:
|
|
|
106
107
|
self.check_health()
|
|
107
108
|
|
|
108
109
|
def check_health(self):
|
|
109
|
-
if self.init_device == "cuda"
|
|
110
|
+
if self.init_device == "cuda":
|
|
110
111
|
# Even though CUDA was available at init time,
|
|
111
112
|
# CUDA can become unavailable - this is a known problem in AWS EC2
|
|
112
113
|
# https://github.com/ray-project/ray/issues/49594
|
|
113
|
-
|
|
114
|
+
try:
|
|
115
|
+
nvmlInit()
|
|
116
|
+
assert nvmlDeviceGetCount() >= 1
|
|
117
|
+
except:
|
|
118
|
+
raise RuntimeError("CUDA device is not available")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|