EnariGmbH commited on
Commit
bd73118
1 Parent(s): 623c6f2

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +10 -1
handler.py CHANGED
@@ -90,7 +90,16 @@ class EndpointHandler:
90
  return [{"error": "Missing 'clip' or 'prompt' in input data"}]
91
 
92
  # Prepare the inputs for the model
93
- inputs_video = self.processor(text=prompt, videos=clip, padding=True, return_tensors="pt").to(self.model.device)
 
 
 
 
 
 
 
 
 
94
 
95
  # Generate output from the model
96
  generate_kwargs = {"max_new_tokens": 512, "do_sample": True, "top_p": 0.9}
 
90
  return [{"error": "Missing 'clip' or 'prompt' in input data"}]
91
 
92
  # Prepare the inputs for the model
93
+ inputs_video = self.processor(
94
+ text=prompt,
95
+ videos=clip,
96
+ padding=True,
97
+ return_tensors="pt"
98
+ ).to(self.model.device)
99
+
100
+ # Check if 'pixel_values_videos' needs to be renamed to 'pixel_values'
101
+ if 'pixel_values_videos' in inputs_video:
102
+ inputs_video['pixel_values'] = inputs_video.pop('pixel_values_videos')
103
 
104
  # Generate output from the model
105
  generate_kwargs = {"max_new_tokens": 512, "do_sample": True, "top_p": 0.9}