class_docstr: Handles the `task name -> model class` and `architecture -> configuration` mappings.
docstr: Validates if the framework requested for the export is both correct and available, otherwise throws an
  exception.
docstr_tok: ["Validates","if","the","framework","requested","for","the","export","is","both","correct","and","available",",","otherwise","throws","an","exception","."]
code: def _validate_framework_choice(framework: str):
      """
      Validates if the framework requested for the export is both correct and available, otherwise throws an
      exception.
      """
      if framework not in ["pt", "tf"]:
          raise ValueError(
              f"Only two frameworks are supported for export: pt or tf, but {framework} was provided."
          )
      elif framework == "pt" and not is_torch_available():
          raise RuntimeError(
              "Cannot export model using PyTorch because no PyTorch package was found."
          )
      elif framework == "tf" and not is_tf_available():
          raise RuntimeError(
              "Cannot export model using TensorFlow because no TensorFlow package was found."
          )
  
imports: import importlib
  import inspect
  import itertools
  import json
  import os
  from functools import partial
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  import huggingface_hub
  from packaging import version
  from requests.exceptions import ConnectionError
  from transformers import AutoConfig, PretrainedConfig, is_tf_available, is_torch_available
  from transformers.utils import SAFE_WEIGHTS_NAME, TF2_WEIGHTS_NAME, WEIGHTS_NAME, logging
  from ..utils import CONFIG_NAME
  from ..utils.import_utils import is_onnx_available
label_desc: Use image node_id 6 for calling the TasksManager obj's underlying member method code with example usage: obj._validate_framework_choice(framework) without return types