code: def test_compile_multimodal_mismatch(multimodal_model):
      """ Test compile function raises an error when multiple loss functions are passed but the number \
      of loss weights does not match the number of loss functions. """
      with pytest.raises(ValueError) as err:
          multimodal_model.compile(
              optimizer=optim.SGD(multimodal_model.parameters(), lr=lr),
              loss=loss_fns,
              loss_weights=loss_weights[:1],
          )
  
      assert (
          "The number of loss weights differs from the number of losses"
          in str(err.value)
      )
  
imports: from typing import List
  import numpy
  import pytest
  import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader, TensorDataset
  from alibi.models.pytorch.metrics import AccuracyMetric, LossContainer
  from alibi.models.pytorch.model import Model
label_desc: Use image node_id 6 for calling a global function with example usage: test_compile_multimodal_mismatch(multimodal_model) without return types