code: def test_init_invalid_task(self):
      with pytest.raises(ValueError, match="is not supported."):
          HuggingFaceLocalGenerator(task="text-classification")
  
imports: from unittest.mock import patch, Mock
  import pytest
  import torch
  from transformers import PreTrainedTokenizerFast
  from haystack.components.generators.hugging_face_local import HuggingFaceLocalGenerator, StopWordsCriteria
label_desc: Use image node_id 7 for calling the TestHuggingFaceLocalGenerator obj's underlying member method code with example usage: obj.test_init_invalid_task() without return types