We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2bd4a8 commit 37f98aeCopy full SHA for 37f98ae
gpt_server/model_worker/embedding.py
@@ -48,6 +48,11 @@ def __init__(
48
self.client = AutoModel.from_pretrained(
49
model_path, trust_remote_code=True
50
) # 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}")
56
self.client.set_processor(model_path)
57
self.client.eval()
58
else:
0 commit comments