# Tokenizers

## models

Definitions of all models available in Transformers.js.

**Example:** Load and run an `AutoModel`.

Copied

```
import { AutoModel, AutoTokenizer } from '@xenova/transformers';

let tokenizer = await AutoTokenizer.from_pretrained('Xenova/bert-base-uncased');
let model = await AutoModel.from_pretrained('Xenova/bert-base-uncased');

let inputs = await tokenizer('I love transformers!');
let { logits } = await model(inputs);
// Tensor {
//     data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...]
//     dims: (3) [1, 6, 30522],
//     type: "float32",
//     size: 183132,
// }
```

We also provide other `AutoModel`s (listed below), which you can use in the same way as the Python library. For example:

**Example:** Load and run a `AutoModelForSeq2SeqLM`.

Copied

```
import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers';

let tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small');
let model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');

let { input_ids } = await tokenizer('translate English to German: I love transformers!');
let outputs = await model.generate(input_ids);
let decoded = tokenizer.decode(outputs[0], { skip_special_tokens: true });
// 'Ich liebe Transformatoren!'
```

* [models](https://huggingface.co/docs/transformers.js/api/models#module_models)
  * *static*
    * [.PreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)
      * [`new PreTrainedModel(config, session)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.PreTrainedModel_new)
      * *instance*
        * [`.dispose()`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+dispose) ⇒ `Promise.<Array<unknown>>`
        * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+_call) ⇒ `Promise.<Object>`
        * [`.forward(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+forward) ⇒ `Promise.<Object>`
        * [`._get_generation_config(generation_config)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+_get_generation_config) ⇒ `GenerationConfig`
        * [`.groupBeams(beams)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+groupBeams) ⇒ `Array`
        * [`.getPastKeyValues(decoderResults, pastKeyValues)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+getPastKeyValues) ⇒ `Object`
        * [`.getAttentions(decoderResults)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+getAttentions) ⇒ `Object`
        * [`.addPastKeyValues(decoderFeeds, pastKeyValues)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+addPastKeyValues)
      * *static*
        * [`.from_pretrained(pretrained_model_name_or_path, options)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel.from_pretrained) ⇒ `Promise.<PreTrainedModel>`
    * [.BaseModelOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.BaseModelOutput)
      * [`new BaseModelOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.BaseModelOutput_new)
    * [.BertForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.BertForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.BertForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.BertForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.CamembertModel](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertModel)
    * [.CamembertForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.CamembertForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.CamembertForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.CamembertForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.DebertaModel](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaModel)
    * [.DebertaForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.DebertaForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.DebertaForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.DebertaForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.DebertaV2Model](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2Model)
    * [.DebertaV2ForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.DebertaV2ForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.DebertaV2ForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.DebertaV2ForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.DistilBertForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.DistilBertForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.DistilBertForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.DistilBertForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.MobileBertForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.MobileBertForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.MobileBertForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.MPNetModel](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetModel)
    * [.MPNetForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.MPNetForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.MPNetForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.MPNetForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.T5ForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.T5ForConditionalGeneration)
      * [`new T5ForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.T5ForConditionalGeneration_new)
    * [.LongT5PreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.LongT5PreTrainedModel)
    * [.LongT5Model](https://huggingface.co/docs/transformers.js/api/models#module_models.LongT5Model)
    * [.LongT5ForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.LongT5ForConditionalGeneration)
      * [`new LongT5ForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.LongT5ForConditionalGeneration_new)
    * [.MT5ForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.MT5ForConditionalGeneration)
      * [`new MT5ForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MT5ForConditionalGeneration_new)
    * [.BartModel](https://huggingface.co/docs/transformers.js/api/models#module_models.BartModel)
    * [.BartForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.BartForConditionalGeneration)
      * [`new BartForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.BartForConditionalGeneration_new)
    * [.BartForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.BartForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.BartForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.MBartModel](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartModel)
    * [.MBartForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartForConditionalGeneration)
      * [`new MBartForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MBartForConditionalGeneration_new)
    * [.MBartForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.MBartForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartForCausalLM)
      * [`new MBartForCausalLM(config, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MBartForCausalLM_new)
    * [.BlenderbotModel](https://huggingface.co/docs/transformers.js/api/models#module_models.BlenderbotModel)
    * [.BlenderbotForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.BlenderbotForConditionalGeneration)
      * [`new BlenderbotForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.BlenderbotForConditionalGeneration_new)
    * [.BlenderbotSmallModel](https://huggingface.co/docs/transformers.js/api/models#module_models.BlenderbotSmallModel)
    * [.BlenderbotSmallForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.BlenderbotSmallForConditionalGeneration)
      * [`new BlenderbotSmallForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.BlenderbotSmallForConditionalGeneration_new)
    * [.RobertaForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.RobertaForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.RobertaForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.RobertaForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.XLMPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMPreTrainedModel)
    * [.XLMModel](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMModel)
    * [.XLMWithLMHeadModel](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMWithLMHeadModel)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMWithLMHeadModel+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.XLMForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.XLMForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.XLMForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.XLMRobertaForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForMaskedLM)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForMaskedLM+_call) ⇒ `Promise.<MaskedLMOutput>`
    * [.XLMRobertaForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.XLMRobertaForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForTokenClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForTokenClassification+_call) ⇒ `Promise.<TokenClassifierOutput>`
    * [.XLMRobertaForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForQuestionAnswering)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForQuestionAnswering+_call) ⇒ `Promise.<QuestionAnsweringModelOutput>`
    * [.WhisperModel](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperModel)
    * [.WhisperForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration)
      * [`new WhisperForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.WhisperForConditionalGeneration_new)
      * [`.generate(inputs, generation_config, logits_processor)`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration+generate) ⇒ `Promise.<Object>`
      * [`._extract_token_timestamps(generate_outputs, alignment_heads, [num_frames], [time_precision])`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration+_extract_token_timestamps) ⇒ `Tensor`
    * [.VisionEncoderDecoderModel](https://huggingface.co/docs/transformers.js/api/models#module_models.VisionEncoderDecoderModel)
      * [`new VisionEncoderDecoderModel(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.VisionEncoderDecoderModel_new)
    * [.CLIPModel](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPModel)
    * [.CLIPTextModelWithProjection](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPTextModelWithProjection)
      * [`.from_pretrained()`](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPTextModelWithProjection.from_pretrained) : `PreTrainedModel.from_pretrained`
    * [.CLIPVisionModelWithProjection](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPVisionModelWithProjection)
      * [`.from_pretrained()`](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPVisionModelWithProjection.from_pretrained) : `PreTrainedModel.from_pretrained`
    * [.GPT2PreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPT2PreTrainedModel)
      * [`new GPT2PreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.GPT2PreTrainedModel_new)
    * [.GPT2LMHeadModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPT2LMHeadModel)
    * [.GPTNeoPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPTNeoPreTrainedModel)
      * [`new GPTNeoPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.GPTNeoPreTrainedModel_new)
    * [.GPTNeoXPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPTNeoXPreTrainedModel)
      * [`new GPTNeoXPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.GPTNeoXPreTrainedModel_new)
    * [.GPTJPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPTJPreTrainedModel)
      * [`new GPTJPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.GPTJPreTrainedModel_new)
    * [.GPTBigCodePreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.GPTBigCodePreTrainedModel)
      * [`new GPTBigCodePreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.GPTBigCodePreTrainedModel_new)
    * [.CodeGenPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.CodeGenPreTrainedModel)
      * [`new CodeGenPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.CodeGenPreTrainedModel_new)
    * [.CodeGenModel](https://huggingface.co/docs/transformers.js/api/models#module_models.CodeGenModel)
    * [.CodeGenForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.CodeGenForCausalLM)
    * [.LlamaPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.LlamaPreTrainedModel)
      * [`new LlamaPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.LlamaPreTrainedModel_new)
    * [.LlamaModel](https://huggingface.co/docs/transformers.js/api/models#module_models.LlamaModel)
    * [.BloomPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.BloomPreTrainedModel)
      * [`new BloomPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.BloomPreTrainedModel_new)
    * [.BloomModel](https://huggingface.co/docs/transformers.js/api/models#module_models.BloomModel)
    * [.BloomForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.BloomForCausalLM)
    * [.MptPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.MptPreTrainedModel)
      * [`new MptPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MptPreTrainedModel_new)
    * [.MptModel](https://huggingface.co/docs/transformers.js/api/models#module_models.MptModel)
    * [.MptForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.MptForCausalLM)
    * [.OPTPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.OPTPreTrainedModel)
      * [`new OPTPreTrainedModel(config, session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.OPTPreTrainedModel_new)
    * [.OPTModel](https://huggingface.co/docs/transformers.js/api/models#module_models.OPTModel)
    * [.OPTForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.OPTForCausalLM)
    * [.DetrObjectDetectionOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.DetrObjectDetectionOutput)
      * [`new DetrObjectDetectionOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.DetrObjectDetectionOutput_new)
    * [.DetrSegmentationOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.DetrSegmentationOutput)
      * [`new DetrSegmentationOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.DetrSegmentationOutput_new)
    * [.ResNetPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.ResNetPreTrainedModel)
    * [.ResNetModel](https://huggingface.co/docs/transformers.js/api/models#module_models.ResNetModel)
    * [.ResNetForImageClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.ResNetForImageClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.ResNetForImageClassification+_call)
    * [.DonutSwinModel](https://huggingface.co/docs/transformers.js/api/models#module_models.DonutSwinModel)
    * [.YolosObjectDetectionOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.YolosObjectDetectionOutput)
      * [`new YolosObjectDetectionOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.YolosObjectDetectionOutput_new)
    * [.SamImageSegmentationOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.SamImageSegmentationOutput)
      * [`new SamImageSegmentationOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.SamImageSegmentationOutput_new)
    * [.MarianMTModel](https://huggingface.co/docs/transformers.js/api/models#module_models.MarianMTModel)
      * [`new MarianMTModel(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MarianMTModel_new)
    * [.M2M100ForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.M2M100ForConditionalGeneration)
      * [`new M2M100ForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.M2M100ForConditionalGeneration_new)
    * [.Wav2Vec2Model](https://huggingface.co/docs/transformers.js/api/models#module_models.Wav2Vec2Model)
    * [.WavLMPreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMPreTrainedModel)
    * [.WavLMModel](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMModel)
    * [.WavLMForCTC](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForCTC)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForCTC+_call)
    * [.WavLMForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForSequenceClassification)
      * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForSequenceClassification+_call) ⇒ `Promise.<SequenceClassifierOutput>`
    * [.SpeechT5PreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5PreTrainedModel)
    * [.SpeechT5Model](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5Model)
    * [.SpeechT5ForSpeechToText](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForSpeechToText)
    * [.SpeechT5ForTextToSpeech](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForTextToSpeech)
      * [`new SpeechT5ForTextToSpeech(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.SpeechT5ForTextToSpeech_new)
      * [`.generate_speech(input_values, speaker_embeddings, options)`](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForTextToSpeech+generate_speech) ⇒ `Promise.<SpeechOutput>`
    * [.SpeechT5HifiGan](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5HifiGan)
    * [.PretrainedMixin](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin)
      * *instance*
        * [`.MODEL_CLASS_MAPPINGS`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin+MODEL_CLASS_MAPPINGS) : `*`
        * [`.BASE_IF_FAIL`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin+BASE_IF_FAIL)
      * *static*
        * [`.from_pretrained()`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin.from_pretrained) : `PreTrainedModel.from_pretrained`
    * [.AutoModel](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModel)
    * [.AutoModelForSequenceClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForSequenceClassification)
    * [.AutoModelForTokenClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForTokenClassification)
    * [.AutoModelForSeq2SeqLM](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForSeq2SeqLM)
    * [.AutoModelForSpeechSeq2Seq](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForSpeechSeq2Seq)
    * [.AutoModelForTextToSpectrogram](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForTextToSpectrogram)
    * [.AutoModelForCausalLM](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForCausalLM)
    * [.AutoModelForMaskedLM](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForMaskedLM)
    * [.AutoModelForQuestionAnswering](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForQuestionAnswering)
    * [.AutoModelForVision2Seq](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForVision2Seq)
    * [.AutoModelForImageClassification](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForImageClassification)
    * [.AutoModelForImageSegmentation](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForImageSegmentation)
    * [.AutoModelForObjectDetection](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForObjectDetection)
    * [.AutoModelForMaskGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.AutoModelForMaskGeneration)
    * [.Seq2SeqLMOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.Seq2SeqLMOutput)
      * [`new Seq2SeqLMOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.Seq2SeqLMOutput_new)
    * [.SequenceClassifierOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.SequenceClassifierOutput)
      * [`new SequenceClassifierOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.SequenceClassifierOutput_new)
    * [.TokenClassifierOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.TokenClassifierOutput)
      * [`new TokenClassifierOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.TokenClassifierOutput_new)
    * [.MaskedLMOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.MaskedLMOutput)
      * [`new MaskedLMOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.MaskedLMOutput_new)
    * [.QuestionAnsweringModelOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.QuestionAnsweringModelOutput)
      * [`new QuestionAnsweringModelOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.QuestionAnsweringModelOutput_new)
    * [.CausalLMOutput](https://huggingface.co/docs/transformers.js/api/models#module_models.CausalLMOutput)
      * [`new CausalLMOutput(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.CausalLMOutput_new)
    * [.CausalLMOutputWithPast](https://huggingface.co/docs/transformers.js/api/models#module_models.CausalLMOutputWithPast)
      * [`new CausalLMOutputWithPast(output)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.CausalLMOutputWithPast_new)
  * *inner*
    * [`~TypedArray`](https://huggingface.co/docs/transformers.js/api/models#module_models..TypedArray) : `*`
    * [`~DecoderOutput`](https://huggingface.co/docs/transformers.js/api/models#module_models..DecoderOutput) ⇒ `Promise.<(Array<Array<number>>|EncoderDecoderOutput|DecoderOutput)>`
    * [`~WhisperGenerationConfig`](https://huggingface.co/docs/transformers.js/api/models#module_models..WhisperGenerationConfig) : `Object`
    * [`~SpeechOutput`](https://huggingface.co/docs/transformers.js/api/models#module_models..SpeechOutput) : `Object`

***

### models.PreTrainedModel

A base class for pre-trained models that provides the model configuration and an ONNX session.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

* [.PreTrainedModel](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)
  * [`new PreTrainedModel(config, session)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.PreTrainedModel_new)
  * *instance*
    * [`.dispose()`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+dispose) ⇒ `Promise.<Array<unknown>>`
    * [`._call(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+_call) ⇒ `Promise.<Object>`
    * [`.forward(model_inputs)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+forward) ⇒ `Promise.<Object>`
    * [`._get_generation_config(generation_config)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+_get_generation_config) ⇒ `GenerationConfig`
    * [`.groupBeams(beams)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+groupBeams) ⇒ `Array`
    * [`.getPastKeyValues(decoderResults, pastKeyValues)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+getPastKeyValues) ⇒ `Object`
    * [`.getAttentions(decoderResults)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+getAttentions) ⇒ `Object`
    * [`.addPastKeyValues(decoderFeeds, pastKeyValues)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel+addPastKeyValues)
  * *static*
    * [`.from_pretrained(pretrained_model_name_or_path, options)`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel.from_pretrained) ⇒ `Promise.<PreTrainedModel>`

***

#### new PreTrainedModel(config, session)

Creates a new instance of the `PreTrainedModel` class.

| Param   | Type     | Description              |
| ------- | -------- | ------------------------ |
| config  | `Object` | The model configuration. |
| session | `any`    | session for the model.   |

***

#### preTrainedModel.dispose() ⇒ \<code> Promise. < Array < unknown > > \</code>

Disposes of all the ONNX sessions that were created during inference.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Promise.<Array<unknown>>` - An array of promises, one for each ONNX session that is being disposed.\
**Todo**

* Use <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry>

***

#### preTrainedModel.\_call(model\_inputs) ⇒ \<code> Promise. < Object > \</code>

Runs the model with the provided inputs

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Promise.<Object>` - Object containing output tensors

| Param         | Type     | Description                     |
| ------------- | -------- | ------------------------------- |
| model\_inputs | `Object` | Object containing input tensors |

***

#### preTrainedModel.forward(model\_inputs) ⇒ \<code> Promise. < Object > \</code>

Forward method for a pretrained model. If not overridden by a subclass, the correct forward method will be chosen based on the model type.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Promise.<Object>` - The output data from the model in the format specified in the ONNX model.\
**Throws**:

* `Error` This method must be implemented in subclasses.

| Param         | Type     | Description                                                            |
| ------------- | -------- | ---------------------------------------------------------------------- |
| model\_inputs | `Object` | The input data to the model in the format specified in the ONNX model. |

***

#### preTrainedModel.\_get\_generation\_config(generation\_config) ⇒ \<code> GenerationConfig \</code>

This function merges multiple generation configs together to form a final generation config to be used by the model for text generation. It first creates an empty `GenerationConfig` object, then it applies the model’s own `generation_config` property to it. Finally, if a `generation_config` object was passed in the arguments, it overwrites the corresponding properties in the final config with those of the passed config object.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `GenerationConfig` - The final generation config object to be used by the model for text generation.

| Param              | Type               | Description                                                   |
| ------------------ | ------------------ | ------------------------------------------------------------- |
| generation\_config | `GenerationConfig` | A `GenerationConfig` object containing generation parameters. |

***

#### preTrainedModel.groupBeams(beams) ⇒ \<code> Array \</code>

Groups an array of beam objects by their ids.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Array` - An array of arrays, where each inner array contains beam objects with the same id.

| Param | Type    | Description                         |
| ----- | ------- | ----------------------------------- |
| beams | `Array` | The array of beam objects to group. |

***

#### preTrainedModel.getPastKeyValues(decoderResults, pastKeyValues) ⇒ \<code> Object \</code>

Returns an object containing past key values from the given decoder results object.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Object` - An object containing past key values.

| Param          | Type     | Description                   |
| -------------- | -------- | ----------------------------- |
| decoderResults | `Object` | The decoder results object.   |
| pastKeyValues  | `Object` | The previous past key values. |

***

#### preTrainedModel.getAttentions(decoderResults) ⇒ \<code> Object \</code>

Returns an object containing attentions from the given decoder results object.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Object` - An object containing attentions.

| Param          | Type     | Description                 |
| -------------- | -------- | --------------------------- |
| decoderResults | `Object` | The decoder results object. |

***

#### preTrainedModel.addPastKeyValues(decoderFeeds, pastKeyValues)

Adds past key values to the decoder feeds object. If pastKeyValues is null, creates new tensors for past key values.

**Kind**: instance method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)

| Param         | Type     | Description                                         |
| ------------- | -------- | --------------------------------------------------- |
| decoderFeeds  | `Object` | The decoder feeds object to add past key values to. |
| pastKeyValues | `Object` | An object containing past key values.               |

***

#### PreTrainedModel.from\_pretrained(pretrained\_model\_name\_or\_path, options) ⇒ \<code> Promise. < PreTrainedModel > \</code>

Instantiate one of the model classes of the library from a pretrained model.

The model class to instantiate is selected based on the `model_type` property of the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)

**Kind**: static method of [`PreTrainedModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.PreTrainedModel)\
**Returns**: `Promise.<PreTrainedModel>` - A new instance of the `PreTrainedModel` class.

| Param                             | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pretrained\_model\_name\_or\_path | `string` | <p>The name or path of the pretrained model. Can be either:</p><ul><li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on boincai.com. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li><li>A path to a <em>directory</em> containing model weights, e.g., <code>./my\_model\_directory/</code>.</li></ul> |
| options                           | `*`      | Additional options for loading the model.                                                                                                                                                                                                                                                                                                                                                                                                                                              |

***

### models.BaseModelOutput

Base class for model’s outputs, with potential hidden states and attentions.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new BaseModelOutput(output)

| Param                      | Type     | Description                                                                                                       |
| -------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
| output                     | `Object` | The output of the model.                                                                                          |
| output.last\_hidden\_state | `Tensor` | Sequence of hidden-states at the output of the last layer of the model.                                           |
| \[output.hidden\_states]   | `Tensor` | Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.               |
| \[output.attentions]       | `Tensor` | Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. |

***

### models.BertForMaskedLM

BertForMaskedLM is a class representing a BERT model for masked language modeling.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### bertForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`BertForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - An object containing the model’s output logits for masked language modeling.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.BertForSequenceClassification

BertForSequenceClassification is a class representing a BERT model for sequence classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### bertForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`BertForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.BertForTokenClassification

BertForTokenClassification is a class representing a BERT model for token classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### bertForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`BertForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.BertForQuestionAnswering

BertForQuestionAnswering is a class representing a BERT model for question answering.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### bertForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`BertForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.BertForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.CamembertModel

The bare CamemBERT Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.CamembertForMaskedLM

CamemBERT Model with a `language modeling` head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### camembertForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`CamembertForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - An object containing the model’s output logits for masked language modeling.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.CamembertForSequenceClassification

CamemBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g. for GLUE tasks.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### camembertForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`CamembertForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.CamembertForTokenClassification

CamemBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### camembertForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`CamembertForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.CamembertForQuestionAnswering

CamemBERT Model with a span classification head on top for extractive question-answering tasks

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### camembertForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`CamembertForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.CamembertForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaModel

The bare DeBERTa Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.DebertaForMaskedLM

DeBERTa Model with a `language modeling` head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - An object containing the model’s output logits for masked language modeling.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaForSequenceClassification

DeBERTa Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaForTokenClassification

DeBERTa Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaForQuestionAnswering

DeBERTa Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaV2Model

The bare DeBERTa-V2 Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.DebertaV2ForMaskedLM

DeBERTa-V2 Model with a `language modeling` head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaV2ForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaV2ForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - An object containing the model’s output logits for masked language modeling.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaV2ForSequenceClassification

DeBERTa-V2 Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaV2ForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaV2ForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaV2ForTokenClassification

DeBERTa-V2 Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaV2ForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaV2ForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DebertaV2ForQuestionAnswering

DeBERTa-V2 Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### debertaV2ForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DebertaV2ForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.DebertaV2ForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DistilBertForSequenceClassification

DistilBertForSequenceClassification is a class representing a DistilBERT model for sequence classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### distilBertForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DistilBertForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DistilBertForTokenClassification

DistilBertForTokenClassification is a class representing a DistilBERT model for token classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### distilBertForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DistilBertForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DistilBertForQuestionAnswering

DistilBertForQuestionAnswering is a class representing a DistilBERT model for question answering.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### distilBertForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DistilBertForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.DistilBertForMaskedLM

DistilBertForMaskedLM is a class representing a DistilBERT model for masking task.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### distilBertForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`DistilBertForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.DistilBertForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MobileBertForMaskedLM

MobileBertForMaskedLM is a class representing a MobileBERT model for masking task.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mobileBertForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MobileBertForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MobileBertForSequenceClassification

MobileBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mobileBertForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MobileBertForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MobileBertForQuestionAnswering

MobileBert Model with a span classification head on top for extractive question-answering tasks

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mobileBertForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MobileBertForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.MobileBertForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MPNetModel

The bare MPNet Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.MPNetForMaskedLM

MPNetForMaskedLM is a class representing a MPNet model for masked language modeling.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mpNetForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MPNetForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - An object containing the model’s output logits for masked language modeling.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MPNetForSequenceClassification

MPNetForSequenceClassification is a class representing a MPNet model for sequence classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mpNetForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MPNetForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MPNetForTokenClassification

MPNetForTokenClassification is a class representing a MPNet model for token classification.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mpNetForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MPNetForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MPNetForQuestionAnswering

MPNetForQuestionAnswering is a class representing a MPNet model for question answering.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mpNetForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MPNetForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.MPNetForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - An object containing the model’s output logits for question answering.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.T5ForConditionalGeneration

T5Model is a class representing a T5 model for conditional generation.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new T5ForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `T5ForConditionalGeneration` class.

| Param                    | Type               | Description                   |
| ------------------------ | ------------------ | ----------------------------- |
| config                   | `Object`           | The model configuration.      |
| session                  | `any`              | session for the model.        |
| decoder\_merged\_session | `any`              | session for the decoder.      |
| generation\_config       | `GenerationConfig` | The generation configuration. |

***

### models.LongT5PreTrainedModel

An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.LongT5Model

The bare LONGT5 Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.LongT5ForConditionalGeneration

LONGT5 Model with a `language modeling` head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new LongT5ForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `LongT5ForConditionalGeneration` class.

| Param                    | Type               | Description                   |
| ------------------------ | ------------------ | ----------------------------- |
| config                   | `Object`           | The model configuration.      |
| session                  | `any`              | session for the model.        |
| decoder\_merged\_session | `any`              | session for the decoder.      |
| generation\_config       | `GenerationConfig` | The generation configuration. |

***

### models.MT5ForConditionalGeneration

A class representing a conditional sequence-to-sequence model based on the MT5 architecture.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MT5ForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `MT5ForConditionalGeneration` class.

| Param                    | Type               | Description                                             |
| ------------------------ | ------------------ | ------------------------------------------------------- |
| config                   | `any`              | The model configuration.                                |
| session                  | `any`              | The ONNX session containing the encoder weights.        |
| decoder\_merged\_session | `any`              | The ONNX session containing the merged decoder weights. |
| generation\_config       | `GenerationConfig` | The generation configuration.                           |

***

### models.BartModel

The bare BART Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.BartForConditionalGeneration

The BART Model with a language modeling head. Can be used for summarization.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new BartForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `BartForConditionalGeneration` class.

| Param                    | Type     | Description                                   |
| ------------------------ | -------- | --------------------------------------------- |
| config                   | `Object` | The configuration object for the Bart model.  |
| session                  | `Object` | The ONNX session used to execute the model.   |
| decoder\_merged\_session | `Object` | The ONNX session used to execute the decoder. |
| generation\_config       | `Object` | The generation configuration object.          |

***

### models.BartForSequenceClassification

Bart model with a sequence classification/head on top (a linear layer on top of the pooled output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### bartForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`BartForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.BartForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MBartModel

The bare MBART Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.MBartForConditionalGeneration

The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MBartForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `MBartForConditionalGeneration` class.

| Param                    | Type     | Description                                   |
| ------------------------ | -------- | --------------------------------------------- |
| config                   | `Object` | The configuration object for the Bart model.  |
| session                  | `Object` | The ONNX session used to execute the model.   |
| decoder\_merged\_session | `Object` | The ONNX session used to execute the decoder. |
| generation\_config       | `Object` | The generation configuration object.          |

***

### models.MBartForSequenceClassification

MBart model with a sequence classification/head on top (a linear layer on top of the pooled output).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### mBartForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`MBartForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.MBartForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.MBartForCausalLM

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MBartForCausalLM(config, decoder\_merged\_session, generation\_config)

Creates a new instance of the `MBartForCausalLM` class.

| Param                    | Type     | Description                                      |
| ------------------------ | -------- | ------------------------------------------------ |
| config                   | `Object` | Configuration object for the model.              |
| decoder\_merged\_session | `Object` | ONNX Session object for the decoder.             |
| generation\_config       | `Object` | Configuration object for the generation process. |

***

### models.BlenderbotModel

The bare Blenderbot Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.BlenderbotForConditionalGeneration

The Blenderbot Model with a language modeling head. Can be used for summarization.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new BlenderbotForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `BlenderbotForConditionalGeneration` class.

| Param                    | Type               | Description                                             |
| ------------------------ | ------------------ | ------------------------------------------------------- |
| config                   | `any`              | The model configuration.                                |
| session                  | `any`              | The ONNX session containing the encoder weights.        |
| decoder\_merged\_session | `any`              | The ONNX session containing the merged decoder weights. |
| generation\_config       | `GenerationConfig` | The generation configuration.                           |

***

### models.BlenderbotSmallModel

The bare BlenderbotSmall Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.BlenderbotSmallForConditionalGeneration

The BlenderbotSmall Model with a language modeling head. Can be used for summarization.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new BlenderbotSmallForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `BlenderbotForConditionalGeneration` class.

| Param                    | Type               | Description                                             |
| ------------------------ | ------------------ | ------------------------------------------------------- |
| config                   | `any`              | The model configuration.                                |
| session                  | `any`              | The ONNX session containing the encoder weights.        |
| decoder\_merged\_session | `any`              | The ONNX session containing the merged decoder weights. |
| generation\_config       | `GenerationConfig` | The generation configuration.                           |

***

### models.RobertaForMaskedLM

RobertaForMaskedLM class for performing masked language modeling on Roberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### robertaForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`RobertaForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.RobertaForSequenceClassification

RobertaForSequenceClassification class for performing sequence classification on Roberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### robertaForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`RobertaForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.RobertaForTokenClassification

RobertaForTokenClassification class for performing token classification on Roberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### robertaForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`RobertaForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.RobertaForQuestionAnswering

RobertaForQuestionAnswering class for performing question answering on Roberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### robertaForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`RobertaForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.RobertaForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMPreTrainedModel

An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.XLMModel

The bare XLM Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.XLMWithLMHeadModel

The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmWithLMHeadModel.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMWithLMHeadModel`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMWithLMHeadModel)\
**Returns**: `Promise.<MaskedLMOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMForSequenceClassification

XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMForTokenClassification

XLM Model with a token classification head on top (a linear layer on top of the hidden-states output)

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMForQuestionAnswering

XLM Model with a span classification head on top for extractive question-answering tasks

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMRobertaForMaskedLM

XLMRobertaForMaskedLM class for performing masked language modeling on XLMRoberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmRobertaForMaskedLM.\_call(model\_inputs) ⇒ \<code> Promise. < MaskedLMOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMRobertaForMaskedLM`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForMaskedLM)\
**Returns**: `Promise.<MaskedLMOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMRobertaForSequenceClassification

XLMRobertaForSequenceClassification class for performing sequence classification on XLMRoberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmRobertaForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMRobertaForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMRobertaForTokenClassification

XLMRobertaForTokenClassification class for performing token classification on XLMRoberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmRobertaForTokenClassification.\_call(model\_inputs) ⇒ \<code> Promise. < TokenClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMRobertaForTokenClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForTokenClassification)\
**Returns**: `Promise.<TokenClassifierOutput>` - An object containing the model’s output logits for token classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.XLMRobertaForQuestionAnswering

XLMRobertaForQuestionAnswering class for performing question answering on XLMRoberta models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### xlmRobertaForQuestionAnswering.\_call(model\_inputs) ⇒ \<code> Promise. < QuestionAnsweringModelOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`XLMRobertaForQuestionAnswering`](https://huggingface.co/docs/transformers.js/api/models#module_models.XLMRobertaForQuestionAnswering)\
**Returns**: `Promise.<QuestionAnsweringModelOutput>` - returned object

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.WhisperModel

WhisperModel class for training Whisper models without a language model head.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.WhisperForConditionalGeneration

WhisperForConditionalGeneration class for generating conditional outputs from Whisper models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

* [.WhisperForConditionalGeneration](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration)
  * [`new WhisperForConditionalGeneration(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.WhisperForConditionalGeneration_new)
  * [`.generate(inputs, generation_config, logits_processor)`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration+generate) ⇒ `Promise.<Object>`
  * [`._extract_token_timestamps(generate_outputs, alignment_heads, [num_frames], [time_precision])`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration+_extract_token_timestamps) ⇒ `Tensor`

***

#### new WhisperForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `WhisperForConditionalGeneration` class.

| Param                    | Type     | Description                                      |
| ------------------------ | -------- | ------------------------------------------------ |
| config                   | `Object` | Configuration object for the model.              |
| session                  | `Object` | ONNX Session object for the model.               |
| decoder\_merged\_session | `Object` | ONNX Session object for the decoder.             |
| generation\_config       | `Object` | Configuration object for the generation process. |

***

#### whisperForConditionalGeneration.generate(inputs, generation\_config, logits\_processor) ⇒ \<code> Promise. < Object > \</code>

Generates outputs based on input and generation configuration.

**Kind**: instance method of [`WhisperForConditionalGeneration`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration)\
**Returns**: `Promise.<Object>` - Promise object represents the generated outputs.

| Param              | Type                      | Default | Description                                      |
| ------------------ | ------------------------- | ------- | ------------------------------------------------ |
| inputs             | `Object`                  |         | Input data for the model.                        |
| generation\_config | `WhisperGenerationConfig` |         | Configuration object for the generation process. |
| logits\_processor  | `Object`                  |         | Optional logits processor object.                |

***

#### whisperForConditionalGeneration.\_extract\_token\_timestamps(generate\_outputs, alignment\_heads, \[num\_frames], \[time\_precision]) ⇒ \<code> Tensor \</code>

Calculates token-level timestamps using the encoder-decoder cross-attentions and dynamic time-warping (DTW) to map each output token to a position in the input audio.

**Kind**: instance method of [`WhisperForConditionalGeneration`](https://huggingface.co/docs/transformers.js/api/models#module_models.WhisperForConditionalGeneration)\
**Returns**: `Tensor` - tensor containing the timestamps in seconds for each predicted token

| Param                                 | Type                           | Default | Description                                |
| ------------------------------------- | ------------------------------ | ------- | ------------------------------------------ |
| generate\_outputs                     | `Object`                       |         | Outputs generated by the model             |
| generate\_outputs.cross\_attentions   | `Array.<Array<Array<Tensor>>>` |         | The cross attentions output by the model   |
| generate\_outputs.decoder\_attentions | `Array.<Array<Array<Tensor>>>` |         | The decoder attentions output by the model |
| generate\_outputs.sequences           | `Array.<Array<number>>`        |         | The sequences output by the model          |
| alignment\_heads                      | `Array.<Array<number>>`        |         | Alignment heads of the model               |
| \[num\_frames]                        | `number`                       |         | Number of frames in the input audio.       |
| \[time\_precision]                    | `number`                       | `0.02`  | Precision of the timestamps in seconds     |

***

### models.VisionEncoderDecoderModel

Vision Encoder-Decoder model based on OpenAI’s GPT architecture for image captioning and other vision tasks

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new VisionEncoderDecoderModel(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `VisionEncoderDecoderModel` class.

| Param                    | Type     | Description                                                                       |
| ------------------------ | -------- | --------------------------------------------------------------------------------- |
| config                   | `Object` | The configuration object specifying the hyperparameters and other model settings. |
| session                  | `Object` | The ONNX session containing the encoder model.                                    |
| decoder\_merged\_session | `any`    | The ONNX session containing the merged decoder model.                             |
| generation\_config       | `Object` | Configuration object for the generation process.                                  |

***

### models.CLIPModel

CLIP Text and Vision Model with a projection layers on top

**Example:** Perform zero-shot image classification with a `CLIPModel`.

Copied

```
import { AutoTokenizer, AutoProcessor, CLIPModel, RawImage } from '@xenova/transformers';

// Load tokenizer, processor, and model
let tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');
let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');
let model = await CLIPModel.from_pretrained('Xenova/clip-vit-base-patch16');

// Run tokenization
let texts = ['a photo of a car', 'a photo of a football match']
let text_inputs = tokenizer(texts, { padding: true, truncation: true });

// Read image and run processor
let image = await RawImage.read('https://boincai.com/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');
let image_inputs = await processor(image);

// Run model with both text and pixel inputs
let output = await model({ ...text_inputs, ...image_inputs });
// {
//   logits_per_image: Tensor {
//     dims: [ 1, 2 ],
//     data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],
//   },
//   logits_per_text: Tensor {
//     dims: [ 2, 1 ],
//     data: Float32Array(2) [ 18.579734802246094, 24.31830596923828 ],
//   },
//   text_embeds: Tensor {
//     dims: [ 2, 512 ],
//     data: Float32Array(1024) [ ... ],
//   },
//   image_embeds: Tensor {
//     dims: [ 1, 512 ],
//     data: Float32Array(512) [ ... ],
//   }
// }
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.CLIPTextModelWithProjection

CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)

**Example:** Compute text embeddings with `CLIPTextModelWithProjection`.

Copied

```
import { AutoTokenizer, CLIPTextModelWithProjection } from '@xenova/transformers';

// Load tokenizer and text model
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/clip-vit-base-patch16');
const text_model = await CLIPTextModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');

// Run tokenization
let texts = ['a photo of a car', 'a photo of a football match'];
let text_inputs = tokenizer(texts, { padding: true, truncation: true });

// Compute embeddings
const { text_embeds } = await text_model(text_inputs);
// Tensor {
//   dims: [ 2, 512 ],
//   type: 'float32',
//   data: Float32Array(1024) [ ... ],
//   size: 1024
// }
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### CLIPTextModelWithProjection.from\_pretrained() : \<code> PreTrainedModel.from\_pretrained \</code>

**Kind**: static method of [`CLIPTextModelWithProjection`](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPTextModelWithProjection)

***

### models.CLIPVisionModelWithProjection

CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)

**Example:** Compute vision embeddings with `CLIPVisionModelWithProjection`.

Copied

```
import { AutoProcessor, CLIPVisionModelWithProjection, RawImage} from '@xenova/transformers';

// Load processor and vision model
const processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16');
const vision_model = await CLIPVisionModelWithProjection.from_pretrained('Xenova/clip-vit-base-patch16');

// Read image and run processor
let image = await RawImage.read('https://boincai.com/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg');
let image_inputs = await processor(image);

// Compute embeddings
const { image_embeds } = await vision_model(image_inputs);
// Tensor {
//   dims: [ 1, 512 ],
//   type: 'float32',
//   data: Float32Array(512) [ ... ],
//   size: 512
// }
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### CLIPVisionModelWithProjection.from\_pretrained() : \<code> PreTrainedModel.from\_pretrained \</code>

**Kind**: static method of [`CLIPVisionModelWithProjection`](https://huggingface.co/docs/transformers.js/api/models#module_models.CLIPVisionModelWithProjection)

***

### models.GPT2PreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new GPT2PreTrainedModel(config, session, generation\_config)

Creates a new instance of the `GPT2PreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.GPT2LMHeadModel

GPT-2 language model head on top of the GPT-2 base model. This model is suitable for text generation tasks.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.GPTNeoPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new GPTNeoPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `GPTNeoPreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.GPTNeoXPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new GPTNeoXPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `GPTNeoXPreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.GPTJPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new GPTJPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `GPTJPreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.GPTBigCodePreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new GPTBigCodePreTrainedModel(config, session, generation\_config)

Creates a new instance of the `GPTBigCodePreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.CodeGenPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new CodeGenPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `CodeGenPreTrainedModel` class.

| Param              | Type               | Description                     |
| ------------------ | ------------------ | ------------------------------- |
| config             | `Object`           | The model configuration object. |
| session            | `Object`           | The ONNX session object.        |
| generation\_config | `GenerationConfig` | The generation configuration.   |

***

### models.CodeGenModel

CodeGenModel is a class representing a code generation model without a language model head.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.CodeGenForCausalLM

CodeGenForCausalLM is a class that represents a code generation model based on the GPT-2 architecture. It extends the `CodeGenPreTrainedModel` class.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.LlamaPreTrainedModel

The bare LLama Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new LlamaPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `LlamaPreTrainedModel` class.

| Param              | Type               | Description                     |
| ------------------ | ------------------ | ------------------------------- |
| config             | `Object`           | The model configuration object. |
| session            | `Object`           | The ONNX session object.        |
| generation\_config | `GenerationConfig` | The generation configuration.   |

***

### models.LlamaModel

The bare LLaMA Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.BloomPreTrainedModel

The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new BloomPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `BloomPreTrainedModel` class.

| Param              | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| config             | `Object`           | The configuration of the model.                |
| session            | `any`              | The ONNX session containing the model weights. |
| generation\_config | `GenerationConfig` | The generation configuration.                  |

***

### models.BloomModel

The bare Bloom Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.BloomForCausalLM

The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.MptPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MptPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `MptPreTrainedModel` class.

| Param              | Type               | Description                     |
| ------------------ | ------------------ | ------------------------------- |
| config             | `Object`           | The model configuration object. |
| session            | `Object`           | The ONNX session object.        |
| generation\_config | `GenerationConfig` | The generation configuration.   |

***

### models.MptModel

The bare Mpt Model transformer outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.MptForCausalLM

The MPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.OPTPreTrainedModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new OPTPreTrainedModel(config, session, generation\_config)

Creates a new instance of the `OPTPreTrainedModel` class.

| Param              | Type               | Description                     |
| ------------------ | ------------------ | ------------------------------- |
| config             | `Object`           | The model configuration object. |
| session            | `Object`           | The ONNX session object.        |
| generation\_config | `GenerationConfig` | The generation configuration.   |

***

### models.OPTModel

The bare OPT Model outputting raw hidden-states without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.OPTForCausalLM

The OPT Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.DetrObjectDetectionOutput

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new DetrObjectDetectionOutput(output)

| Param              | Type     | Description                                                                                                                                                                                                                             |
| ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| output             | `Object` | The output of the model.                                                                                                                                                                                                                |
| output.logits      | `Tensor` | Classification logits (including no-object) for all queries.                                                                                                                                                                            |
| output.pred\_boxes | `Tensor` | Normalized boxes coordinates for all queries, represented as (center\_x, center\_y, width, height). These values are normalized in \[0, 1], relative to the size of each individual image in the batch (disregarding possible padding). |

***

### models.DetrSegmentationOutput

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new DetrSegmentationOutput(output)

| Param              | Type     | Description                     |
| ------------------ | -------- | ------------------------------- |
| output             | `Object` | The output of the model.        |
| output.logits      | `Tensor` | The output logits of the model. |
| output.pred\_boxes | `Tensor` | Predicted boxes.                |
| output.pred\_masks | `Tensor` | Predicted masks.                |

***

### models.ResNetPreTrainedModel

An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.ResNetModel

The bare ResNet model outputting raw features without any specific head on top.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.ResNetForImageClassification

ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for ImageNet.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### resNetForImageClassification.\_call(model\_inputs)

**Kind**: instance method of [`ResNetForImageClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.ResNetForImageClassification)

| Param         | Type  |
| ------------- | ----- |
| model\_inputs | `any` |

***

### models.DonutSwinModel

The bare Donut Swin Model transformer outputting raw hidden-states without any specific head on top.

**Example:** Step-by-step Document Parsing.

Copied

```
import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';

// Choose model to use
const model_id = 'Xenova/donut-base-finetuned-cord-v2';

// Prepare image inputs
const processor = await AutoProcessor.from_pretrained(model_id);
const url = 'https://boincai.com/datasets/Xenova/transformers.js-docs/resolve/main/receipt.png';
const image = await RawImage.read(url);
const image_inputs = await processor(image);

// Prepare decoder inputs
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const task_prompt = '<s_cord-v2>';
const decoder_input_ids = tokenizer(task_prompt, {
  add_special_tokens: false,
}).input_ids;

// Create the model
const model = await AutoModelForVision2Seq.from_pretrained(model_id);

// Run inference
const output = await model.generate(image_inputs.pixel_values, {
  decoder_input_ids,
  max_length: model.config.decoder.max_position_embeddings,
});

// Decode output
const decoded = tokenizer.batch_decode(output)[0];
// <s_cord-v2><s_menu><s_nm> CINNAMON SUGAR</s_nm><s_unitprice> 17,000</s_unitprice><s_cnt> 1 x</s_cnt><s_price> 17,000</s_price></s_menu><s_sub_total><s_subtotal_price> 17,000</s_subtotal_price></s_sub_total><s_total><s_total_price> 17,000</s_total_price><s_cashprice> 20,000</s_cashprice><s_changeprice> 3,000</s_changeprice></s_total></s>
```

**Example:** Step-by-step Document Visual Question Answering (DocVQA)

Copied

```
import { AutoProcessor, AutoTokenizer, AutoModelForVision2Seq, RawImage } from '@xenova/transformers';

// Choose model to use
const model_id = 'Xenova/donut-base-finetuned-docvqa';

// Prepare image inputs
const processor = await AutoProcessor.from_pretrained(model_id);
const url = 'https://boincai.com/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';
const image = await RawImage.read(url);
const image_inputs = await processor(image);

// Prepare decoder inputs
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const question = 'What is the invoice number?';
const task_prompt = `<s_docvqa><s_question>${question}</s_question><s_answer>`;
const decoder_input_ids = tokenizer(task_prompt, {
  add_special_tokens: false,
}).input_ids;

// Create the model
const model = await AutoModelForVision2Seq.from_pretrained(model_id);

// Run inference
const output = await model.generate(image_inputs.pixel_values, {
  decoder_input_ids,
  max_length: model.config.decoder.max_position_embeddings,
});

// Decode output
const decoded = tokenizer.batch_decode(output)[0];
// <s_docvqa><s_question> What is the invoice number?</s_question><s_answer> us-001</s_answer></s>
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.YolosObjectDetectionOutput

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new YolosObjectDetectionOutput(output)

| Param              | Type     | Description                                                                                                                                                                                                                             |
| ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| output             | `Object` | The output of the model.                                                                                                                                                                                                                |
| output.logits      | `Tensor` | Classification logits (including no-object) for all queries.                                                                                                                                                                            |
| output.pred\_boxes | `Tensor` | Normalized boxes coordinates for all queries, represented as (center\_x, center\_y, width, height). These values are normalized in \[0, 1], relative to the size of each individual image in the batch (disregarding possible padding). |

***

### models.SamImageSegmentationOutput

Base class for Segment-Anything model’s output.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new SamImageSegmentationOutput(output)

| Param              | Type     | Description                     |
| ------------------ | -------- | ------------------------------- |
| output             | `Object` | The output of the model.        |
| output.iou\_scores | `Tensor` | The output logits of the model. |
| output.pred\_masks | `Tensor` | Predicted boxes.                |

***

### models.MarianMTModel

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MarianMTModel(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `MarianMTModel` class.

| Param                    | Type     | Description                     |
| ------------------------ | -------- | ------------------------------- |
| config                   | `Object` | The model configuration object. |
| session                  | `Object` | The ONNX session object.        |
| decoder\_merged\_session | `any`    |                                 |
| generation\_config       | `any`    |                                 |

***

### models.M2M100ForConditionalGeneration

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new M2M100ForConditionalGeneration(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `M2M100ForConditionalGeneration` class.

| Param                    | Type     | Description                     |
| ------------------------ | -------- | ------------------------------- |
| config                   | `Object` | The model configuration object. |
| session                  | `Object` | The ONNX session object.        |
| decoder\_merged\_session | `any`    |                                 |
| generation\_config       | `any`    |                                 |

***

### models.Wav2Vec2Model

The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.

**Example:** Load and run an `Wav2Vec2Model` for feature extraction.

Copied

```
import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';

// Read and preprocess audio
const processor = await AutoProcessor.from_pretrained('Xenova/mms-300m');
const audio = await read_audio('https://boincai.com/datasets/Narsil/asr_dummy/resolve/main/mlk.flac', 16000);
const inputs = await processor(audio);

// Run model with inputs
const model = await AutoModel.from_pretrained('Xenova/mms-300m');
const output = await model(inputs);
// {
//   last_hidden_state: Tensor {
//     dims: [ 1, 1144, 1024 ],
//     type: 'float32',
//     data: Float32Array(1171456) [ ... ],
//     size: 1171456
//   }
// }
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.WavLMPreTrainedModel

An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.WavLMModel

The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.

**Example:** Load and run an `WavLMModel` for feature extraction.

Copied

```
import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';

// Read and preprocess audio
const processor = await AutoProcessor.from_pretrained('Xenova/wavlm-base');
const audio = await read_audio('https://boincai.com/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);
const inputs = await processor(audio);

// Run model with inputs
const model = await AutoModel.from_pretrained('Xenova/wavlm-base');
const output = await model(inputs);
// {
//   last_hidden_state: Tensor {
//     dims: [ 1, 549, 768 ],
//     type: 'float32',
//     data: Float32Array(421632) [-0.349443256855011, -0.39341306686401367,  0.022836603224277496, ...],
//     size: 421632
//   }
// }
```

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.WavLMForCTC

WavLM Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### wavLMForCTC.\_call(model\_inputs)

**Kind**: instance method of [`WavLMForCTC`](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForCTC)

| Param                         | Type     | Description                                                                                                  |
| ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| model\_inputs                 | `Object` |                                                                                                              |
| model\_inputs.input\_values   | `Tensor` | Float values of input raw speech waveform.                                                                   |
| model\_inputs.attention\_mask | `Tensor` | Mask to avoid performing convolution and attention on padding token indices. Mask values selected in \[0, 1] |

***

### models.WavLMForSequenceClassification

WavLM Model with a sequence classification head on top (a linear layer over the pooled output).

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### wavLMForSequenceClassification.\_call(model\_inputs) ⇒ \<code> Promise. < SequenceClassifierOutput > \</code>

Calls the model on new inputs.

**Kind**: instance method of [`WavLMForSequenceClassification`](https://huggingface.co/docs/transformers.js/api/models#module_models.WavLMForSequenceClassification)\
**Returns**: `Promise.<SequenceClassifierOutput>` - An object containing the model’s output logits for sequence classification.

| Param         | Type     | Description              |
| ------------- | -------- | ------------------------ |
| model\_inputs | `Object` | The inputs to the model. |

***

### models.SpeechT5PreTrainedModel

An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.SpeechT5Model

The bare SpeechT5 Encoder-Decoder Model outputting raw hidden-states without any specific pre- or post-nets.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.SpeechT5ForSpeechToText

SpeechT5 Model with a speech encoder and a text decoder.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.SpeechT5ForTextToSpeech

SpeechT5 Model with a text encoder and a speech decoder.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

* [.SpeechT5ForTextToSpeech](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForTextToSpeech)
  * [`new SpeechT5ForTextToSpeech(config, session, decoder_merged_session, generation_config)`](https://huggingface.co/docs/transformers.js/api/models#new_module_models.SpeechT5ForTextToSpeech_new)
  * [`.generate_speech(input_values, speaker_embeddings, options)`](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForTextToSpeech+generate_speech) ⇒ `Promise.<SpeechOutput>`

***

#### new SpeechT5ForTextToSpeech(config, session, decoder\_merged\_session, generation\_config)

Creates a new instance of the `SpeechT5ForTextToSpeech` class.

| Param                    | Type               | Description                   |
| ------------------------ | ------------------ | ----------------------------- |
| config                   | `Object`           | The model configuration.      |
| session                  | `any`              | session for the model.        |
| decoder\_merged\_session | `any`              | session for the decoder.      |
| generation\_config       | `GenerationConfig` | The generation configuration. |

***

#### speechT5ForTextToSpeech.generate\_speech(input\_values, speaker\_embeddings, options) ⇒ \<code> Promise. < SpeechOutput > \</code>

Converts a sequence of input tokens into a sequence of mel spectrograms, which are subsequently turned into a speech waveform using a vocoder.

**Kind**: instance method of [`SpeechT5ForTextToSpeech`](https://huggingface.co/docs/transformers.js/api/models#module_models.SpeechT5ForTextToSpeech)\
**Returns**: `Promise.<SpeechOutput>` - A promise which resolves to an object containing the spectrogram, waveform, and cross-attention tensors.

| Param                                | Type      | Default | Description                                                                                                         |
| ------------------------------------ | --------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| input\_values                        | `Tensor`  |         | Indices of input sequence tokens in the vocabulary.                                                                 |
| speaker\_embeddings                  | `Tensor`  |         | Tensor containing the speaker embeddings.                                                                           |
| options                              | `Object`  |         | Optional parameters for generating speech.                                                                          |
| \[options.threshold]                 | `number`  | `0.5`   | The generated sequence ends when the predicted stop token probability exceeds this value.                           |
| \[options.minlenratio]               | `number`  | `0.0`   | Used to calculate the minimum required length for the output sequence.                                              |
| \[options.maxlenratio]               | `number`  | `20.0`  | Used to calculate the maximum allowed length for the output sequence.                                               |
| \[options.vocoder]                   | `Object`  |         | The vocoder that converts the mel spectrogram into a speech waveform. If `null`, the output is the mel spectrogram. |
| \[options.output\_cross\_attentions] | `boolean` | `false` | Whether or not to return the attentions tensors of the decoder's cross-attention layers.                            |

***

### models.SpeechT5HifiGan

HiFi-GAN vocoder.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.PretrainedMixin

Base class of all AutoModels. Contains the `from_pretrained` function which is used to instantiate pretrained models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

* [.PretrainedMixin](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin)
  * *instance*
    * [`.MODEL_CLASS_MAPPINGS`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin+MODEL_CLASS_MAPPINGS) : `*`
    * [`.BASE_IF_FAIL`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin+BASE_IF_FAIL)
  * *static*
    * [`.from_pretrained()`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin.from_pretrained) : `PreTrainedModel.from_pretrained`

***

#### pretrainedMixin.MODEL\_CLASS\_MAPPINGS : \<code> \* \</code>

Mapping from model type to model class.

**Kind**: instance property of [`PretrainedMixin`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin)

***

#### pretrainedMixin.BASE\_IF\_FAIL

Whether to attempt to instantiate the base class (`PretrainedModel`) if the model type is not found in the mapping.

**Kind**: instance property of [`PretrainedMixin`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin)

***

#### PretrainedMixin.from\_pretrained() : \<code> PreTrainedModel.from\_pretrained \</code>

**Kind**: static method of [`PretrainedMixin`](https://huggingface.co/docs/transformers.js/api/models#module_models.PretrainedMixin)

***

### models.AutoModel

Helper class which is used to instantiate pretrained models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForSequenceClassification

Helper class which is used to instantiate pretrained sequence classification models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForTokenClassification

Helper class which is used to instantiate pretrained token classification models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForSeq2SeqLM

Helper class which is used to instantiate pretrained sequence-to-sequence models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForSpeechSeq2Seq

Helper class which is used to instantiate pretrained sequence-to-sequence speech-to-text models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForTextToSpectrogram

Helper class which is used to instantiate pretrained sequence-to-sequence text-to-spectrogram models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForCausalLM

Helper class which is used to instantiate pretrained causal language models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForMaskedLM

Helper class which is used to instantiate pretrained masked language models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForQuestionAnswering

Helper class which is used to instantiate pretrained question answering models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForVision2Seq

Helper class which is used to instantiate pretrained vision-to-sequence models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForImageClassification

Helper class which is used to instantiate pretrained image classification models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForImageSegmentation

Helper class which is used to instantiate pretrained image segmentation models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForObjectDetection

Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.AutoModelForMaskGeneration

Helper class which is used to instantiate pretrained object detection models with the `from_pretrained` function. The chosen model class is determined by the type specified in the model config.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models.Seq2SeqLMOutput

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new Seq2SeqLMOutput(output)

| Param                         | Type     | Description                                                                                                                                                |
| ----------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| output                        | `Object` | The output of the model.                                                                                                                                   |
| output.logits                 | `Tensor` | The output logits of the model.                                                                                                                            |
| output.past\_key\_values      | `Tensor` | An tensor of key/value pairs that represent the previous state of the model.                                                                               |
| output.encoder\_outputs       | `Tensor` | The output of the encoder in a sequence-to-sequence model.                                                                                                 |
| \[output.decoder\_attentions] | `Tensor` | Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the self-attention heads.                          |
| \[output.cross\_attentions]   | `Tensor` | Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the weighted average in the cross-attention heads. |

***

### models.SequenceClassifierOutput

Base class for outputs of sentence classification models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new SequenceClassifierOutput(output)

| Param         | Type     | Description                                                                      |
| ------------- | -------- | -------------------------------------------------------------------------------- |
| output        | `Object` | The output of the model.                                                         |
| output.logits | `Tensor` | classification (or regression if config.num\_labels==1) scores (before SoftMax). |

***

### models.TokenClassifierOutput

Base class for outputs of token classification models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new TokenClassifierOutput(output)

| Param         | Type     | Description                             |
| ------------- | -------- | --------------------------------------- |
| output        | `Object` | The output of the model.                |
| output.logits | `Tensor` | Classification scores (before SoftMax). |

***

### models.MaskedLMOutput

Base class for masked language models outputs.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new MaskedLMOutput(output)

| Param         | Type     | Description                                                                                        |
| ------------- | -------- | -------------------------------------------------------------------------------------------------- |
| output        | `Object` | The output of the model.                                                                           |
| output.logits | `Tensor` | Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax). |

***

### models.QuestionAnsweringModelOutput

Base class for outputs of question answering models.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new QuestionAnsweringModelOutput(output)

| Param                | Type     | Description                         |
| -------------------- | -------- | ----------------------------------- |
| output               | `Object` | The output of the model.            |
| output.start\_logits | `Tensor` | Span-start scores (before SoftMax). |
| output.end\_logits   | `Tensor` | Span-end scores (before SoftMax).   |

***

### models.CausalLMOutput

Base class for causal language model (or autoregressive) outputs.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new CausalLMOutput(output)

| Param         | Type     | Description                                                                                        |
| ------------- | -------- | -------------------------------------------------------------------------------------------------- |
| output        | `Object` | The output of the model.                                                                           |
| output.logits | `Tensor` | Prediction scores of the language modeling head (scores for each vocabulary token before softmax). |

***

### models.CausalLMOutputWithPast

Base class for causal language model (or autoregressive) outputs.

**Kind**: static class of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

#### new CausalLMOutputWithPast(output)

| Param                    | Type     | Description                                                                                                                                                       |
| ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| output                   | `Object` | The output of the model.                                                                                                                                          |
| output.logits            | `Tensor` | Prediction scores of the language modeling head (scores for each vocabulary token before softmax).                                                                |
| output.past\_key\_values | `Tensor` | Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see `past_key_values` input) to speed up sequential decoding. |

***

### models\~TypedArray : \<code> \* \</code>

**Kind**: inner typedef of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)

***

### models\~DecoderOutput ⇒ \<code> Promise. < (Array < Array < number > > |EncoderDecoderOutput|DecoderOutput) > \</code>

Generates text based on the given inputs and generation configuration using the model.

**Kind**: inner typedef of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)\
**Returns**: `Promise.<(Array<Array<number>>|EncoderDecoderOutput|DecoderOutput)>` - An array of generated output sequences, where each sequence is an array of token IDs.\
**Throws**:

* `Error` Throws an error if the inputs array is empty.

| Param                              | Type                                     | Default | Description                                                                                       |
| ---------------------------------- | ---------------------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| inputs                             | `Tensor` \| `Array` \| `TypedArray`      |         | An array of input token IDs.                                                                      |
| generation\_config                 | `Object` \| `GenerationConfig` \| `null` |         | The generation configuration to use. If null, default configuration will be used.                 |
| logits\_processor                  | `Object` \| `null`                       |         | An optional logits processor to use. If null, a new LogitsProcessorList instance will be created. |
| options                            | `Object`                                 |         | options                                                                                           |
| \[options.inputs\_attention\_mask] | `Object`                                 |         | An optional attention mask for the inputs.                                                        |

***

### models\~WhisperGenerationConfig : \<code> Object \</code>

**Kind**: inner typedef of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)\
**Extends**: `GenerationConfig`\
**Properties**

| Name                         | Type      | Default | Description                                                                                                                                                                                              |
| ---------------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \[return\_timestamps]        | `boolean` |         | Whether to return the timestamps with the text. This enables the `WhisperTimestampsLogitsProcessor`.                                                                                                     |
| \[return\_token\_timestamps] | `boolean` |         | Whether to return token-level timestamps with the text. This can be used with or without the `return_timestamps` option. To get word-level timestamps, use the tokenizer to group the tokens into words. |
| \[num\_frames]               | `number`  |         | The number of audio frames available in this chunk. This is only used generating word-level timestamps.                                                                                                  |

***

### models\~SpeechOutput : \<code> Object \</code>

**Kind**: inner typedef of [`models`](https://huggingface.co/docs/transformers.js/api/models#module_models)\
**Properties**

| Name                 | Type     | Description                                                                                                                                                                                                               |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \[spectrogram]       | `Tensor` | The predicted log-mel spectrogram of shape `(output_sequence_length, config.num_mel_bins)`. Returned when no `vocoder` is provided                                                                                        |
| \[waveform]          | `Tensor` | The predicted waveform of shape `(num_frames,)`. Returned when a `vocoder` is provided.                                                                                                                                   |
| \[cross\_attentions] | `Tensor` | The outputs of the decoder's cross-attention layers of shape `(config.decoder_layers, config.decoder_attention_heads, output_sequence_length, input_sequence_length)`. returned when `output_cross_attentions` is `true`. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boinc-ai.gitbook.io/transformers.js/api-reference/tokenizers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
