modalities.models.huggingface package
Submodules
modalities.models.huggingface.huggingface_model module
- class modalities.models.huggingface.huggingface_model.HuggingFaceModelTypes(value)[source]
- Bases: - LookupEnum- HuggingFaceModelTypes enumeration class representing different types of HuggingFace models. - Attributes:
- AutoModelForCausalLM: Represents the AutoModelForCausalLM class. AutoModelForMaskedLM: Represents the AutoModelForMaskedLM class. 
 - AutoModelForCausalLM(*args, **kwargs) = <class 'transformers.models.auto.modeling_auto.AutoModelForCausalLM'>
- Return type:
- None 
 
 - AutoModelForMaskedLM(*args, **kwargs) = <class 'transformers.models.auto.modeling_auto.AutoModelForMaskedLM'>
- Return type:
- None 
 
 
- class modalities.models.huggingface.huggingface_model.HuggingFacePretrainedModel(model_type, model_name, prediction_key, huggingface_prediction_subscription_key, sample_key, model_args=None, kwargs=None)[source]
- Bases: - NNModel- HuggingFacePretrainedModel class for HuggingFace models. - Initializes a HuggingFaceModel object. - Args:
- model_type (HuggingFaceModelTypes): The type of Hugging Face model. model_name (str): The name of the Hugging Face model. prediction_key (str): The key for accessing predictions. huggingface_prediction_subscription_key (str): The subscription key for Hugging Face predictions. sample_key (str): The key for accessing samples. model_args (Any, optional): Additional arguments for the Hugging Face model. Defaults to None. kwargs (Any, optional): Additional keyword arguments for the Hugging Face model. Defaults to None. 
 - Parameters:
 
- class modalities.models.huggingface.huggingface_model.HuggingFacePretrainedModelConfig(**data)[source]
- Bases: - BaseModel- Configuration class for HuggingFacePretrainedModel. - Attributes:
- model_type (HuggingFaceModelTypes): The type of the HuggingFace model. model_name (Path): The path to the HuggingFace model. prediction_key (str): The key for accessing the prediction. huggingface_prediction_subscription_key (str): The subscription key for HuggingFace prediction. sample_key (str): The key for accessing the sample. model_args (Any, optional): Optional additional arguments for the model. kwargs (Any, optional): Optional additional keyword arguments. 
 - Create a new model by parsing and validating input data from keyword arguments. - Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. - self is explicitly positional-only to allow self as a field name. - Parameters:
 - model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}
- Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. 
 - 
model_type: HuggingFaceModelTypes