Unverified Commit 47489a69 authored by Murilo Gonçalves's avatar Murilo Gonçalves Committed by GitHub
Browse files

Fix: replace asserts statements with exception (#14029)

parent cd3166a8
...@@ -935,8 +935,10 @@ class LxmertModel(LxmertPreTrainedModel): ...@@ -935,8 +935,10 @@ class LxmertModel(LxmertPreTrainedModel):
else: else:
raise ValueError("You have to specify either input_ids or inputs_embeds") raise ValueError("You have to specify either input_ids or inputs_embeds")
assert visual_feats is not None, "`visual_feats` cannot be `None`" if visual_feats is None:
assert visual_pos is not None, "`visual_pos` cannot be `None`" raise ValueError("`visual_feats` cannot be `None`")
if visual_pos is None:
raise ValueError("`visual_pos` cannot be `None`")
device = input_ids.device if input_ids is not None else inputs_embeds.device device = input_ids.device if input_ids is not None else inputs_embeds.device
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment