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

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

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

Loading…
Cancel
Save