revert-250-master
Kye 1 year ago
parent b2c46c043a
commit 574c1ae66e

@ -272,7 +272,7 @@ class HuggingfaceLLM:
try:
inputs = self.tokenizer.encode(
task, return_tensors="pt"
).to(self.device)
)
# self.log.start()
@ -451,7 +451,8 @@ class HuggingfaceLLM:
The new device to use for inference.
"""
self.device = device
self.model.to(self.device)
if self.model is not None:
self.model.to(self.device)
def set_max_length(self, max_length):
"""Set max_length"""

@ -36,7 +36,7 @@ def test_encode_image(vision_api):
def test_run_success(vision_api):
expected_response = {
"choices": [{"text": "This is the model's response."}]
"This is the model's response."
}
with patch(
"requests.post",

Loading…
Cancel
Save