





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowerCamelCase : Optional[Any]											=			{
    "configuration_clap": [
        "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
        "ClapAudioConfig",
        "ClapConfig",
        "ClapTextConfig",
    ],
    "processing_clap": ["ClapProcessor"],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__lowerCamelCase : str											=			[
			    "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "ClapModel",
			    "ClapPreTrainedModel",
			    "ClapTextModel",
			    "ClapTextModelWithProjection",
			    "ClapAudioModel",
			    "ClapAudioModelWithProjection",
			]
			__lowerCamelCase : Dict											=			["ClapFeatureExtractor"]

if TYPE_CHECKING:
			from .configuration_clap import (
			    CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
			    ClapAudioConfig,
			    ClapConfig,
			    ClapTextConfig,
			)
			from .processing_clap import ClapProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_clap import ClapFeatureExtractor
						from .modeling_clap import (
						    CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
						    ClapAudioModel,
						    ClapAudioModelWithProjection,
						    ClapModel,
						    ClapPreTrainedModel,
						    ClapTextModel,
						    ClapTextModelWithProjection,
						)


else:
			import sys

			__lowerCamelCase : str											=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)











'''simple docstring'''

from argparse import ArgumentParser

from . import BaseTransformersCLICommand







def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






				return DownloadCommand(args.model		,							args.cache_dir		,							args.force		,							args.trust_remote_code							)


class       UpperCAmelCase (						_lowercase  ):




		@staticmethod
		def 				UpperCAmelCase__   (A__      :	ArgumentParser				)					-> List[Any]:
						lowercase         = parser.add_parser("download"				)
						download_parser.add_argument(
						    "--cache-dir"							,			type=A__							,			default=A__							,			help="Path to location to store the models"				)
						download_parser.add_argument(
						    "--force"							,			action="store_true"							,			help="Force the model to be download even if already in cache-dir"				)
						download_parser.add_argument(
						    "--trust-remote-code"							,			action="store_true"							,			help="Whether or not to allow for custom models defined on the Hub in their own modeling files. Use only if you've reviewed the code as it will execute on your local machine"							,			)
						download_parser.add_argument("model"							,			type=A__							,			help="Name of the model to download"				)
						download_parser.set_defaults(func=A__				)




		def __init__(self      :	Tuple							,			A__      :	str							,			A__      :	str							,			A__      :	bool							,			A__      :	bool				)					-> str:
						lowercase         = model
						lowercase         = cache
						lowercase         = force
						lowercase         = trust_remote_code





		def 				UpperCAmelCase__   (self      :	Union[str, Any]				)					-> Dict:
						from ..models.auto import AutoModel, AutoTokenizer

						AutoModel.from_pretrained(
						    self._model							,			cache_dir=self._cache							,			force_download=self._force							,			trust_remote_code=self._trust_remote_code				)
						AutoTokenizer.from_pretrained(
						    self._model							,			cache_dir=self._cache							,			force_download=self._force							,			trust_remote_code=self._trust_remote_code				)




