class_docstr: Generator based on a Hugging Face model.
  This component provides an interface to generate text using a Hugging Face model that runs locally.
  
  Usage example:
  ```python
  from haystack.components.generators import HuggingFaceLocalGenerator
  
  generator = HuggingFaceLocalGenerator(model="google/flan-t5-large",
                                        task="text2text-generation",
                                        generation_kwargs={
                                          "max_new_tokens": 100,
                                          "temperature": 0.9,
                                          })
  
  print(generator.run("Who is the best American actor?"))
  # {'replies': ['John Cusack']}
  ```
docstr: Data that is sent to Posthog for usage analytics.
code: def _get_telemetry_data(self) -> Dict[str, Any]:
      """
      Data that is sent to Posthog for usage analytics.
      """
      if isinstance(self.huggingface_pipeline_kwargs["model"], str):
          return {"model": self.huggingface_pipeline_kwargs["model"]}
      return {
          "model": f"[object of type {type(self.huggingface_pipeline_kwargs['model'])}]"
      }
  
file_path: haystack/haystack/components/generators/hugging_face_local.py
imports: import logging
  from typing import Any, Dict, List, Literal, Optional, Union
  from haystack import component, default_to_dict, default_from_dict
  from haystack.components.generators.hf_utils import StopWordsCriteria
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 2 for calling the HuggingFaceLocalGenerator obj's underlying member method code with example usage: obj._get_telemetry_data() and returns: dict, dict