EnariGmbH commited on
Commit
c87b098
1 Parent(s): 6479e6c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +9 -10
handler.py CHANGED
@@ -89,19 +89,18 @@ class EndpointHandler:
89
  if clip is None or prompt is None:
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
- # Debug: Check specific components
 
 
 
101
  if 'pixel_values_videos' in inputs_video:
102
- print(f"pixel_values_videos shape: {inputs_video['pixel_values_videos'].shape}")
 
103
  else:
104
- print("pixel_values not found in inputs_video")
105
 
106
  if 'input_ids' in inputs_video:
107
  print(f"input_ids shape: {inputs_video['input_ids'].shape}")
 
89
  if clip is None or prompt is None:
90
  return [{"error": "Missing 'clip' or 'prompt' in input data"}]
91
 
92
+ # Ensure clip_bytes is converted properly to the expected format by the model
93
+ inputs_video = ml.processor(text=prompt, videos=clip, padding=True, return_tensors="pt").to(ml.model.device)
 
 
 
 
 
94
 
95
+ # Debug: Print the entire inputs_video structure
96
+ print(f"Keys in inputs_video: {inputs_video.keys()}")
97
+
98
+ # Rename pixel_values_videos to pixel_values if it exists
99
  if 'pixel_values_videos' in inputs_video:
100
+ inputs_video['pixel_values'] = inputs_video.pop('pixel_values_videos')
101
+ print(f"Renamed pixel_values_videos to pixel_values. New shape: {inputs_video['pixel_values'].shape}")
102
  else:
103
+ print("pixel_values_videos not found in inputs_video")
104
 
105
  if 'input_ids' in inputs_video:
106
  print(f"input_ids shape: {inputs_video['input_ids'].shape}")