Spaces:
Runtime error
Runtime error
Update demo/infer.py
Browse files- demo/infer.py +3 -2
demo/infer.py
CHANGED
|
@@ -204,7 +204,6 @@ class LiveCCDemoInfer:
|
|
| 204 |
images=image_inputs,
|
| 205 |
videos=video_inputs,
|
| 206 |
return_tensors="pt",
|
| 207 |
-
return_attention_mask=False
|
| 208 |
)
|
| 209 |
inputs.to(self.model.device)
|
| 210 |
if past_ids is not None:
|
|
@@ -217,4 +216,6 @@ class LiveCCDemoInfer:
|
|
| 217 |
)
|
| 218 |
state['past_key_values'] = outputs.past_key_values
|
| 219 |
state['past_ids'] = outputs.sequences[:, :-1]
|
| 220 |
-
|
|
|
|
|
|
|
|
|
| 204 |
images=image_inputs,
|
| 205 |
videos=video_inputs,
|
| 206 |
return_tensors="pt",
|
|
|
|
| 207 |
)
|
| 208 |
inputs.to(self.model.device)
|
| 209 |
if past_ids is not None:
|
|
|
|
| 216 |
)
|
| 217 |
state['past_key_values'] = outputs.past_key_values
|
| 218 |
state['past_ids'] = outputs.sequences[:, :-1]
|
| 219 |
+
response = self.processor.decode(outputs.sequences[0, inputs.input_ids.size(1):], skip_special_tokens=True)
|
| 220 |
+
print(response)
|
| 221 |
+
return response, state
|