djai.model.models.ml.hugging_face package

DjAI Pre-Trained Hugging Face Model classes.

class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceAudioClassifier(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Audio Classifier Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: _predict ------------------------------ inputs: |-Audio(label="Audio to Classify") |-Slider(label="No. of Labels to Return") outputs: |-Label(label="Audio Classification")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(audio_or_audios: Union[numpy.ndarray, str, collections.abc.Sequence[Union[numpy.ndarray, str]]], n_labels: int = 5) Union[Dict[str, float], List[Dict[str, float]]][source]

Classify Audio(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceImageClassifier(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Image Classifier Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Image(label="Upload an Image to Classify") |-Slider(label="No. of Labels to Return") outputs: |-Label(label="Likely ImageNet Classes")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(image_or_images: Union[str, PIL.Image.Image, collections.abc.Sequence[Union[str, PIL.Image.Image]]], n_labels: int = 5) Union[Dict[str, float], List[Dict[str, float]]][source]

Classify Image(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceMaskFiller(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Mask Filler Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: _predict ------------------------------ inputs: |-Textbox(label="Text to Generate from") |-Dataframe(label="Targets") |-Slider(label="No. of Labels to Return") outputs: |-Label(label="Generated Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], targets: Optional[List[str]] = None, n_labels: int = 5) Union[Dict[str, float], List[Dict[str, float]]][source]

Classify Image(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceObjectDetector(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Object Detector Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: _predict ------------------------------ inputs: |-Image(label="Upload an Image to Detect Objects") |-Slider(label="Confidence Threshold") outputs: |-Image(label="Detected Objects") |-JSON(label="Detected Objects")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(image_or_images: Union[str, PIL.Image.Image, collections.abc.Sequence[Union[str, PIL.Image.Image]]], threshold: float = 0.9) Union[List[dict], collections.abc.Sequence[List[dict]]][source]

Detect Objects from Image(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceQuestionAnswerer(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Question Answerer Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: <lambda> ------------------------------ inputs: |-Textbox(label="Question") |-Textbox(label="Context") |-Number(label="Top K") |-Number(label="Doc Stride") |-Number(label="Max Answer Length") |-Number(label="Max Sequence Length") |-Number(label="Max Question Length") |-Checkbox(label="Handle Impossible Answer?") outputs: |-JSON(label="Likely Answer(s)")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(question: Union[str, collections.abc.Sequence[str]], context: Union[str, collections.abc.Sequence[str]], top_k: int = 1, doc_stride: int = 128, max_answer_len: int = 15, max_seq_len: int = 384, max_question_len: int = 64, handle_impossible_answer: bool = False) Union[dict, List[dict]][source]

Answer Question(s) based on Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceSpeechRecognizer(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Speech Recognizer Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: _predict ------------------------------ inputs: |-Audio(label="Recorded Speech to Transcribe") outputs: |-Textbox(label="Transcribed Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(speech_or_speeches: Union[numpy.ndarray, str, collections.abc.Sequence[Union[numpy.ndarray, str]]]) Union[str, List[str]][source]

Recognize Speech(es).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTableQuestionAnswerer(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Table Question Answerer Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Dataframe(label="Data Table") |-Textbox(label="Query") |-Checkbox(label="Sequential?") |-Checkbox(label="Padding?") |-Checkbox(label="Truncation?") outputs: |-JSON(label="Likely Answer(s)")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(table: Union[dict, pandas.core.frame.DataFrame], queries: Union[str, collections.abc.Sequence[str]], sequential: bool = False, padding: Union[bool, str] = False, truncation: Union[bool, str] = False) Union[dict, List[dict]][source]

Answer Question(s) on a Tabular Data Set.

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceText2TextGenerator(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Text-to-Text Generator Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text to Generate from") |-Checkbox(label="Return Tensors?") |-Checkbox(label="Return Text?") outputs: |-JSON(label="Generated Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], return_tensors: bool = False, return_text: bool = True, clean_up_tokenization_spaces: bool = True, **generate_kwargs) Union[str, List[int], List[Union[str, List[int]]]][source]

Generate Text-to-Text.

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTextClassifier(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Text Classifier Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text to Classify") outputs: |-Label(label="Likely Text Classes")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]]) Union[Dict[str, float], collections.abc.Sequence[Dict[str, float]]][source]

Classify Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTextGenerator(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Text Generator Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text to Generate from") |-Checkbox(label="Return Tensors?") |-Checkbox(label="Return Text?") |-Checkbox(label="Return Full Text?") |-Checkbox(label="Clean Up Spaces?") |-Textbox(label="Generated Text Prefix") outputs: |-JSON(label="Generated Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], return_tensors: bool = False, return_text: bool = True, return_full_text: bool = True, clean_up_tokenization_spaces: bool = True, prefix: Optional[str] = None, **generate_kwargs) Union[str, List[int], List[Union[str, List[int]]]][source]

Generate Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTextSummarizer(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Text Summarizer Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text to Summarize") |-Checkbox(label="Return Text?") |-Checkbox(label="Return Tensors?") |-Checkbox(label="Clean Up Spaces?") outputs: |-JSON(label="Summary Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], return_text: bool = True, return_tensors: bool = False, clean_up_tokenization_spaces: bool = True, **generate_kwargs) Union[str, List[int], List[Union[str, List[int]]]][source]

Summarize Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTokenClassifier(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Token Classifier Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text from which to Recognize Tokens") outputs: |-JSON(label="Recognized Tokens")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]]) Union[List[dict], collections.abc.Sequence[List[dict]]][source]

Classify Tokens in Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTransformer(*args, **kwargs)[source]

Bases: djai.model.models.ml.base._PreTrainedMLModelABC

DjAI Pre-Trained Hugging Face Transformer Model class.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

aimodel_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

aimodel_ptr_id
artifact_global_url: CharField

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

artifact_local_path: CharField

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

loader_module_and_qualname: django.db.models.fields.CharField

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
pretrained_hugging_face_audio_classifiers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_image_classifiers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_mask_fillers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_object_detectors

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_question_answerers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_speech_recognizers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_table_question_answerers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_text2text_generators

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_text_classifiers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_text_generators

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_text_summarizers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_token_classifiers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_translators

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

pretrained_hugging_face_zero_shot_classifiers

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceTranslator(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Translator Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: predict ----------------------------- inputs: |-Textbox(label="Text to Summarize") |-Checkbox(label="Return Tensors?") |-Checkbox(label="Return Text?") |-Checkbox(label="Clean Up Spaces?") |-Dropdown(label="Source Language") |-Dropdown(label="Target Language") outputs: |-JSON(label="Translated Text")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], return_tensors: bool = False, return_text: bool = True, clean_up_tokenization_spaces: bool = True, src_lang: Optional[str] = None, tgt_lang: Optional[str] = None, **generate_kwargs) Union[str, List[int], List[Union[str, List[int]]]][source]

Translate Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id
class djai.model.models.ml.hugging_face.PreTrainedHuggingFaceZeroShotClassifier(*args, **kwargs)[source]

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer

DjAI Pre-Trained Hugging Face Zero-Shot Classifier Model class.

exception DoesNotExist

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist

exception MultipleObjectsReturned

Bases: djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned

gradio_ui = Gradio Interface for: <lambda> ------------------------------ inputs: |-Textbox(label="Text to Classify") |-Dataframe(label="Candidate Labels") |-Textbox(label="Hypothesis Format") |-Checkbox(label="Multi-Label?") outputs: |-Label(label="Label Probabilities")
polymorphic_primary_key_name = 'uuid'
polymorphic_super_sub_accessors_replaced = False
predict(text_or_texts: Union[str, collections.abc.Sequence[str]], candidate_labels: List[str], hypothesis_template: str = 'This example is {}.', multi_label: bool = False) Union[Dict[str, float], List[Dict[str, float]]][source]

Zero-Shot Classification of Text(s).

pretrainedhuggingfacetransformer_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

pretrainedhuggingfacetransformer_ptr_id

Submodules