Skip to content

Commit 37f98ae

Browse files
committed
clip_text_model add to cuda
1 parent b2bd4a8 commit 37f98ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gpt_server/model_worker/embedding.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def __init__(
4848
self.client = AutoModel.from_pretrained(
4949
model_path, trust_remote_code=True
5050
) # You must set trust_remote_code=True
51+
if device == "cuda":
52+
self.client.to(
53+
torch.device("cuda" if torch.cuda.is_available() else "cpu")
54+
)
55+
logger.info(f"device: {self.client.device}")
5156
self.client.set_processor(model_path)
5257
self.client.eval()
5358
else:

0 commit comments

Comments
 (0)