mirror of
https://github.com/Vision-CAIR/MiniGPT-4.git
synced 2025-04-07 11:30:45 +00:00
remove some inappropriate assertions
This commit is contained in:
parent
d2db151df2
commit
49f6b84880
@ -96,7 +96,7 @@ class ImageBindJoiner(nn.Module):
|
|||||||
def forward(self, inputs: Dict[str, Tensor]) -> Dict[str, Tensor]:
|
def forward(self, inputs: Dict[str, Tensor]) -> Dict[str, Tensor]:
|
||||||
outputs = {}
|
outputs = {}
|
||||||
for modality_key, modality_value in inputs.items():
|
for modality_key, modality_value in inputs.items():
|
||||||
assert modality_key == ModalityType.VISION, "Only Vision is Currently Supported."
|
# assert modality_key == ModalityType.VISION, "Only Vision is Currently Supported."
|
||||||
if modality_value is not None:
|
if modality_value is not None:
|
||||||
modality_value = self.modality_pre_projectors[modality_key](modality_value)
|
modality_value = self.modality_pre_projectors[modality_key](modality_value)
|
||||||
modality_value = self.modality_qformers[modality_key](modality_value)
|
modality_value = self.modality_qformers[modality_key](modality_value)
|
||||||
|
@ -110,7 +110,7 @@ class BindGPT4(BaseModel):
|
|||||||
Other modalities will conflict with the pre-defined prompt and wrapping strategy.
|
Other modalities will conflict with the pre-defined prompt and wrapping strategy.
|
||||||
"""
|
"""
|
||||||
embeds = self.encode_inputs(inputs)
|
embeds = self.encode_inputs(inputs)
|
||||||
assert "vision" in embeds, "Only Vision Input Can Be Accepted Now."
|
# assert "vision" in embeds, "Only Vision Input Can Be Accepted Now."
|
||||||
prompt = random.choice(self.prompt_list)
|
prompt = random.choice(self.prompt_list)
|
||||||
img_embeds, atts_img = self.prompt_wrap(embeds, ModalityType.VISION, prompt)
|
img_embeds, atts_img = self.prompt_wrap(embeds, ModalityType.VISION, prompt)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user