class_docstr: Transcribes audio files using OpenAI's Whisper's model on your local machine.
  
  For the supported audio formats, languages, and other parameters, see the
  [Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
  [github repo](https://github.com/openai/whisper).
class_docstr_tok: ["Transcribes","audio","files","using","OpenAI","'s","Whisper","'s","model","on","your","local","machine",".","For","the","supported","audio","formats",",","languages",",","and","other","parameters",",","see","the","[","Whisper","API","documentation","]","(","https",":","\/\/platform.openai.com\/docs\/guides\/speech-to-text",")","and","the","official","Whisper","[","github","repo","]","(","https",":","\/\/github.com\/openai\/whisper",")","."]
docstr: :param model: Name of the model to use. Set it to one of the following values:
  :type model: Literal["tiny", "small", "medium", "large", "large-v2"]
  :param device: Name of the torch device to use for inference. If None, CPU is used.
  :type device: Optional[str]
docstr_tok: [":","param","model",":","Name","of","the","model","to","use",".","Set","it","to","one","of","the","following","values",":",":","type","model",":","Literal","[","``","tiny","''",",","``","small","''",",","``","medium","''",",","``","large","''",",","``","large-v2","''","]",":","param","device",":","Name","of","the","torch","device","to","use","for","inference",".","If","None",",","CPU","is","used",".",":","type","device",":","Optional","[","str","]"]
code: def __init__(
      self,
      model: WhisperLocalModel = "large",
      device: Optional[str] = None,
      whisper_params: Optional[Dict[str, Any]] = None,
  ):
      """
      :param model: Name of the model to use. Set it to one of the following values:
      :type model: Literal["tiny", "small", "medium", "large", "large-v2"]
      :param device: Name of the torch device to use for inference. If None, CPU is used.
      :type device: Optional[str]
      """
      whisper_import.check()
      if model not in get_args(WhisperLocalModel):
          raise ValueError(
              f"Model name '{model}' not recognized. Choose one among: "
              f"{', '.join(get_args(WhisperLocalModel))}."
          )
      self.model = model
      self.whisper_params = whisper_params or {}
      self.device = (
          torch.device(device) if device else torch.device("cpu")
      )
      self._model = None
  
file_path: haystack/haystack/components/audio/whisper_local.py
imports: from typing import List, Optional, Dict, Any, Union, Literal, get_args
  import logging
  import tempfile
  from pathlib import Path
  from haystack import component, Document, default_to_dict, ComponentError
  from haystack.dataclasses import ByteStream
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 1 to create a new LocalWhisperTranscriber object  with example: obj = LocalWhisperTranscriber(model, device, whisper_params)