thoth-AI commited on
Commit
f49e3ec
·
1 Parent(s): 60be62e

Updated handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -34,10 +34,10 @@ class EndpointHandler:
34
  raw_images = inputs
35
 
36
  inputs = self.processor(inputs, return_tensors="pt").to("cuda")
37
-
38
- out = self.model.generate(**inputs)
39
 
40
  processed_image = self.processor(images=raw_images, return_tensors="pt").to(device)
 
 
41
  # processed_image["pixel_values"] = processed_image["pixel_values"].to(device)
42
  # processed_image = {**processed_image, **parameters}
43
 
@@ -46,6 +46,6 @@ class EndpointHandler:
46
  # **processed_image
47
  # )
48
  captions = self.processor.decode(out[0], skip_special_tokens=True)
49
-
50
  # postprocess the prediction
51
  return {"captions": captions}
 
34
  raw_images = inputs
35
 
36
  inputs = self.processor(inputs, return_tensors="pt").to("cuda")
 
 
37
 
38
  processed_image = self.processor(images=raw_images, return_tensors="pt").to(device)
39
+
40
+ out = self.model.generate(**processed_image)
41
  # processed_image["pixel_values"] = processed_image["pixel_values"].to(device)
42
  # processed_image = {**processed_image, **parameters}
43
 
 
46
  # **processed_image
47
  # )
48
  captions = self.processor.decode(out[0], skip_special_tokens=True)
49
+
50
  # postprocess the prediction
51
  return {"captions": captions}