vector listlengths 1.02k 1.02k | text stringlengths 2 11.8k |
|---|---|
[
0.028625801,
-0.013404704,
0.0048894784,
-0.020585796,
0.0068677985,
0.034074984,
-0.0073500583,
-0.05018316,
-0.00863843,
0.03675029,
0.00443538,
0.003889758,
0.007589428,
-0.055561934,
-0.0076809516,
-0.014840922,
-0.023092138,
-0.032357153,
-0.060828067,
-0.0030414034,
0.0... | MarianMT
Overview
A framework for translation models, using the same models as BART. Translations should be similar, but not identical to output in the test set linked to in each model card.
This model was contributed by sshleifer.
Implementation Notes |
[
-0.0029503903,
-0.030760027,
-0.017992217,
-0.0066671157,
0.0013144314,
0.014527049,
0.0015659892,
0.0352914,
0.02844103,
0.058001578,
0.022363659,
0.021430729,
0.05693537,
-0.026841722,
-0.015060152,
0.04614004,
-0.020217922,
-0.049285345,
-0.034038607,
-0.00077341544,
0.008... | MobileViTV2Config
[[autodoc]] MobileViTV2Config
MobileViTV2Model
[[autodoc]] MobileViTV2Model
- forward
MobileViTV2ForImageClassification
[[autodoc]] MobileViTV2ForImageClassification
- forward
MobileViTV2ForSemanticSegmentation
[[autodoc]] MobileViTV2ForSemanticSegmentation
- forward |
[
-0.0019829234,
-0.042114187,
0.006784985,
0.02404912,
-0.00034467407,
-0.0024698332,
-0.018403787,
0.017966272,
-0.0026744767,
0.060574427,
0.04606592,
0.024190253,
0.03649708,
-0.00766354,
-0.032488894,
0.03404136,
-0.02570038,
-0.052473374,
-0.027789153,
0.006700305,
0.0381... |
FlaxRobertaPreLayerNormModel
[[autodoc]] FlaxRobertaPreLayerNormModel
- call
FlaxRobertaPreLayerNormForCausalLM
[[autodoc]] FlaxRobertaPreLayerNormForCausalLM
- call
FlaxRobertaPreLayerNormForMaskedLM
[[autodoc]] FlaxRobertaPreLayerNormForMaskedLM
- call
FlaxRobertaPreLayerNormForSequenceClassification
[[... |
[
0.022284247,
0.0038115866,
-0.0036872162,
-0.018216604,
-0.011266494,
0.031546183,
0.011222599,
-0.009422886,
-0.022810994,
0.015407297,
0.040383797,
0.016475419,
0.019782208,
-0.07134471,
-0.009583836,
0.03183882,
-0.002181969,
-0.009452149,
-0.06619431,
-0.025986096,
0.0233... | Each model is about 298 MB on disk, there are more than 1,000 models.
The list of supported language pairs can be found here.
Models were originally trained by Jörg Tiedemann using the Marian C++ library, which supports fast training and translation.
All models are transformer encoder-decoders with 6 layers in each com... |
[
0.047795393,
-0.0062793572,
-0.011466979,
-0.020630023,
0.0017260703,
0.0013298459,
0.016820244,
0.0022324093,
0.015690863,
0.046229318,
0.031411845,
-0.024228983,
0.045867916,
-0.043699507,
-0.0142226685,
0.008214363,
0.0035970777,
-0.018160442,
-0.040175837,
0.008937166,
-0... | The modeling code is the same as [BartForConditionalGeneration] with a few minor modifications:
static (sinusoid) positional embeddings (MarianConfig.static_position_embeddings=True)
no layernorm_embedding (MarianConfig.normalize_embedding=False)
the model starts generating with pad_token_id (which has 0 as a token_e... |
[
0.0034055822,
0.0055748397,
-0.03173487,
-0.004968054,
-0.01600396,
-0.006390207,
0.022405546,
-0.02386183,
-0.006648091,
0.04068495,
0.052820656,
0.022132492,
0.0030965009,
-0.05515678,
-0.02061553,
0.03549694,
0.012211553,
-0.037256613,
-0.04939232,
-0.010436706,
0.04556957... | All model names use the following format: Helsinki-NLP/opus-mt-{src}-{tgt}
The language codes used to name models are inconsistent. Two digit codes can usually be found here, three digit codes require googling "language
code {code}".
Codes formatted like es_AR are usually code_{region}. That one is Spanish from Argen... |
[
0.0015358798,
-0.019980108,
-0.02817633,
-0.0053705657,
0.0064862436,
-0.0123964185,
0.01599867,
-0.003388962,
-0.016873712,
0.03549751,
0.006092475,
0.03188067,
0.0016589324,
-0.04859396,
-0.016159095,
0.02556579,
-0.008057672,
-0.06714483,
-0.07426184,
-0.024894925,
0.03354... | Multilingual Models
All model names use the following format: Helsinki-NLP/opus-mt-{src}-{tgt}:
If a model can output multiple languages, and you should specify a language code by prepending the desired output
language to the src_text.
You can see a models's supported language codes in its model card, under target c... |
[
0.041582502,
-0.0005731139,
-0.0018810326,
-0.01541397,
-0.013104583,
-0.011519843,
0.03857556,
-0.02118405,
-0.017039344,
0.03204697,
-0.034376673,
0.026033085,
-0.0032524425,
-0.03841302,
-0.019016884,
0.0086077135,
-0.019192966,
-0.023744015,
-0.02635816,
-0.029988162,
0.0... | New multi-lingual models from the Tatoeba-Challenge repo
require 3 character language codes:
thon |
[
0.016219268,
-0.016246969,
0.01734118,
-0.033574298,
-0.016773298,
0.019211035,
0.016745597,
-0.005872732,
-0.018961722,
0.028158642,
0.06493247,
0.024086513,
-0.005917747,
-0.061940704,
-0.0091553675,
0.005450283,
0.004657326,
-0.038255863,
-0.054211963,
-0.0036912337,
0.029... | Examples
Since Marian models are smaller than many other translation models available in the library, they can be useful for
fine-tuning experiments and integration tests.
Fine-tune on GPU
Multilingual Models |
[
0.03638277,
-0.01837345,
-0.019845147,
0.017538983,
-0.018494828,
-0.011591508,
0.035138655,
-0.012759762,
-0.007096764,
0.04117716,
0.02976772,
0.03786964,
0.02300095,
-0.035836574,
-0.03601864,
0.018130695,
-0.026020205,
-0.037717916,
-0.035411753,
0.0049195634,
0.030253228... |
Old Style Multi-Lingual Models
These are the old style multi-lingual models ported from the OPUS-MT-Train repo: and the members of each language
group:
python no-style
['Helsinki-NLP/opus-mt-NORTH_EU-NORTH_EU',
'Helsinki-NLP/opus-mt-ROMANCE-en',
'Helsinki-NLP/opus-mt-SCANDINAVIA-SCANDINAVIA',
'Helsinki-NLP/opus-mt... |
[
-0.0058949804,
-0.010511954,
-0.03277876,
0.01223937,
-0.00072546175,
0.000117399286,
0.015785486,
-0.011326508,
-0.007330982,
0.023916978,
0.0033775885,
0.03390228,
0.022961983,
-0.066063106,
-0.0324417,
-0.0007465278,
-0.0087985825,
-0.048199102,
-0.05210334,
0.00012145889,
... |
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>fr<< this is a sentence in english that we want to translate to french",
">>pt<< This should go to portuguese",
">>es<< And this to Spanish",
]
model_name = "Helsinki-NLP/opus-mt-en-ROMANCE"
tokenizer = MarianTokenizer.from_pretra... |
[
0.000057033973,
-0.010930318,
-0.04622656,
-0.0029312514,
-0.008169116,
0.008243198,
-0.0029464045,
0.009994204,
-0.024190823,
0.028258543,
0.013664582,
0.00092769647,
0.012317654,
-0.06616109,
-0.018668419,
-0.015031713,
-0.010829299,
-0.019059027,
-0.056948103,
-0.0013241983,... | Resources
Translation task guide
Summarization task guide
Causal language modeling task guide
MarianConfig
[[autodoc]] MarianConfig
MarianTokenizer
[[autodoc]] MarianTokenizer
- build_inputs_with_special_tokens
MarianModel
[[autodoc]] MarianModel
- forward
MarianMTModel
[[autodoc]] MarianMTModel
- forwar... |
[
0.0037894677,
-0.016016144,
-0.03597289,
0.012784556,
0.009627598,
0.012590511,
0.01329952,
-0.02437499,
-0.0096649155,
0.023240576,
0.01141878,
0.034122,
0.019762699,
-0.05836265,
-0.032271113,
-0.00398911,
-0.0013228619,
-0.047317035,
-0.050391898,
0.000008563793,
0.0000248... |
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>fra<< this is a sentence in english that we want to translate to french",
">>por<< This should go to portuguese",
">>esp<< And this to Spanish",
]
model_name = "Helsinki-NLP/opus-mt-en-roa"
tokenizer = MarianTokenizer.from_pretrai... |
[
0.021915553,
-0.007715615,
-0.02729244,
0.02574786,
-0.027729586,
-0.011817495,
0.041412234,
0.01697581,
0.03086246,
0.016917525,
0.019117823,
0.013529648,
0.01668438,
-0.059451766,
-0.016859239,
0.030046456,
0.007905045,
-0.029449023,
-0.06790324,
-0.015868375,
0.00863362,
... | Here is the code to see all available pretrained models on the hub:
thon
from huggingface_hub import list_models
model_list = list_models()
org = "Helsinki-NLP"
model_ids = [x.modelId for x in model_list if x.modelId.startswith(org)]
suffix = [x.split("/")[1] for x in model_ids]
old_style_multi_models = [f"{org}/{s}" f... |
[
0.014246637,
-0.034005523,
-0.015950907,
0.004197432,
0.005825144,
-0.012735428,
0.008188488,
0.042287216,
0.022874506,
0.05554857,
0.031955075,
0.027880803,
0.00048806382,
-0.038772155,
-0.036082603,
0.032620806,
0.021170236,
-0.06742521,
-0.037334178,
-0.0064243013,
0.05429... | TFMarianModel
[[autodoc]] TFMarianModel
- call
TFMarianMTModel
[[autodoc]] TFMarianMTModel
- call
FlaxMarianModel
[[autodoc]] FlaxMarianModel
- call
FlaxMarianMTModel
[[autodoc]] FlaxMarianMTModel
- call |
[
0.0033032424,
-0.05585584,
-0.0044836355,
-0.02574187,
-0.034619913,
-0.0124471085,
-0.026485424,
0.009376227,
-0.03197286,
0.043007214,
-0.018380675,
-0.006238425,
0.06620612,
-0.011041789,
0.014172155,
-0.0065693073,
-0.024879346,
-0.01707202,
-0.09148699,
0.0010521301,
-0.... |
VisionTextDualEncoder
Overview
The [VisionTextDualEncoderModel] can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (e.g. ViT, BEiT, DeiT) and any pretrained text autoencoding model as the text encoder (e.g. RoBERTa, BERT). Two projection layer... |
[
-0.0145249395,
-0.038751494,
-0.016531222,
0.0060566384,
-0.016751088,
-0.0058573848,
-0.0000727342,
0.034711443,
-0.012724781,
0.08794665,
0.008519832,
0.03460151,
0.01782294,
0.0051290765,
-0.00016812068,
0.048920326,
0.014538681,
-0.04663921,
-0.05656069,
-0.007207503,
0.0... | VisionTextDualEncoderModel
[[autodoc]] VisionTextDualEncoderModel
- forward
FlaxVisionTextDualEncoderModel
[[autodoc]] FlaxVisionTextDualEncoderModel
- call
TFVisionTextDualEncoderModel
[[autodoc]] TFVisionTextDualEncoderModel
- call |
[
0.038728036,
-0.007571449,
-0.04616665,
-0.0038890387,
0.024898702,
-0.026241787,
0.012087752,
-0.025415273,
-0.01686972,
0.0526902,
-0.0052284324,
0.022448683,
-0.019378778,
-0.0446317,
-0.019275462,
-0.005745003,
-0.011194822,
-0.037399713,
-0.03003489,
-0.016057966,
0.0219... |
NLLB-MOE
Overview
The NLLB model was presented in No Language Left Behind: Scaling Human-Centered Machine Translation by Marta R. Costa-jussà, James Cross, Onur Çelebi,
Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al ... |
[
0.05110947,
-0.01125419,
-0.05255324,
-0.012315361,
0.01432942,
-0.004457641,
0.008871969,
-0.020775855,
-0.016170228,
0.055354156,
-0.0018859251,
0.034044106,
0.01917327,
-0.03635414,
-0.017108679,
0.009449477,
-0.022984825,
-0.040021315,
-0.03748028,
-0.013571441,
0.0074281... | M2M100ForConditionalGeneration is the base model for both NLLB and NLLB MoE
The NLLB-MoE is very similar to the NLLB model, but it's feed forward layer is based on the implementation of SwitchTransformers.
The tokenizer is the same as the NLLB models. |
[
0.020377023,
-0.030191645,
-0.017977893,
0.00086900295,
-0.0043932116,
-0.067611836,
0.019971976,
0.021436378,
-0.0382926,
0.06511923,
-0.020859964,
0.034834117,
0.029521758,
-0.032684248,
-0.011162184,
0.009518624,
-0.03165605,
0.006987076,
-0.012969321,
-0.02595422,
0.01135... |
Implementation differences with SwitchTransformers
The biggest difference is the way the tokens are routed. NLLB-MoE uses a top-2-gate which means that for each input, only the top two experts are selected based on the
highest predicted probabilities from the gating network, and the remaining experts are ignored. In... |
[
0.020715991,
0.025000567,
-0.016777644,
0.00034126927,
-0.00040393297,
-0.019071408,
-0.0045153936,
0.002412778,
0.022822212,
0.03993166,
0.0076458743,
0.018595343,
0.0062862067,
-0.03626741,
-0.041951325,
0.024452372,
-0.020138944,
-0.0520785,
-0.03000645,
-0.025202531,
0.01... |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-moe-54b")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-moe-54b")
article = "Previously, Ring's CEO, Jamie Siminoff, remarked the company started when his doorbell wasn't audible from ... |
[
0.02045209,
0.012167876,
-0.014808206,
0.02407032,
-0.0014790744,
-0.01086168,
0.010868665,
0.00034706734,
0.015786108,
0.04861562,
0.0026019136,
-0.000064447566,
0.020913098,
-0.037719015,
-0.02204467,
0.037299916,
-0.028205441,
-0.062473867,
-0.02460118,
-0.009171309,
0.002... |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-moe-54b", src_lang="ron_Latn")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-moe-54b")
article = "Şeful ONU spune că nu există o soluţie militară în Siria"
inputs = tokenizer(article, ... |
[
0.015575667,
-0.03311384,
-0.041848376,
0.017856045,
-0.020246984,
-0.005887519,
0.011443348,
0.007856936,
0.0043534474,
0.07214284,
-0.0053347005,
0.014304184,
0.010586479,
-0.031206615,
-0.020164063,
0.030349746,
-0.017551994,
-0.04486124,
-0.033860147,
0.032367535,
-0.0075... | Resources
Translation task guide
Summarization task guide
NllbMoeConfig
[[autodoc]] NllbMoeConfig
NllbMoeTop2Router
[[autodoc]] NllbMoeTop2Router
- route_tokens
- forward
NllbMoeSparseMLP
[[autodoc]] NllbMoeSparseMLP
- forward
NllbMoeModel
[[autodoc]] NllbMoeModel
- forward
NllbMoeForConditionalGenera... |
[
-0.005801877,
0.00528278,
-0.0029380168,
0.010579686,
-0.018433232,
-0.018503856,
0.001074389,
-0.010798625,
0.014435833,
0.04514376,
-0.0008841418,
0.008573924,
0.0077899825,
-0.04873153,
-0.0090188645,
0.012952699,
-0.015904842,
-0.035510454,
-0.04183849,
-0.008602174,
0.01... | from transformers import AutoModel, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("Tanrei/GPTSAN-japanese")
model = AutoModel.from_pretrained("Tanrei/GPTSAN-japanese").cuda()
x_tok = tokenizer("は、", prefix_text="織田信長", return_tensors="pt")
torch.manual_seed(0)
gen_tok = model.generate(x_tok.input... |
[
-0.020021213,
-0.0060965237,
-0.022912052,
0.005692235,
-0.006389901,
-0.015599086,
0.018275259,
-0.0015795864,
-0.019506013,
0.038325094,
-0.00398206,
0.0085222535,
-0.0014400532,
-0.039670337,
-0.016672418,
-0.029566709,
-0.03760954,
-0.032400303,
-0.05564151,
0.03219995,
-... | Generating from any other language than English
English (eng_Latn) is set as the default language from which to translate. In order to specify that you'd like to translate from a different language,
you should specify the BCP-47 code in the src_lang keyword argument of the tokenizer initialization.
See example below fo... |
[
0.00736071,
0.004495467,
-0.0071441066,
-0.014523816,
-0.0131405955,
0.0075393124,
0.0035207525,
-0.018133871,
0.0063308943,
0.037909366,
-0.0034352513,
0.016249042,
-0.002538438,
-0.06101371,
-0.037696563,
0.05289679,
-0.009492542,
-0.011742176,
-0.03140367,
-0.030978061,
0.... |
GPTSAN Features
GPTSAN has some unique features. It has a model structure of Prefix-LM. It works as a shifted Masked Language Model for Prefix Input tokens. Un-prefixed inputs behave like normal generative models.
The Spout vector is a GPTSAN specific input. Spout is pre-trained with random inputs, but you can specif... |
[
0.022466118,
0.0058522597,
0.017942829,
0.014294135,
-0.006518454,
-0.049961146,
0.014854422,
0.0066311946,
-0.006672191,
0.064883895,
-0.0021266968,
0.04638078,
0.005151902,
-0.056247286,
-0.028205637,
0.017505534,
-0.0044754585,
-0.045697503,
-0.043593016,
-0.010249142,
-0.... |
x_token = tokenizer("アイウエ")
input_ids: | SOT | SEG | ア | イ | ウ | エ |
token_type_ids: | 1 | 0 | 0 | 0 | 0 | 0 |
prefix_lm_mask:
SOT | 1 0 0 0 0 0 |
SEG | 1 1 0 0 0 0 |
ア | 1 1 1 0 0 0 |
イ | 1 1 1 1 0 0 |
ウ | 1 1 1 1 1 0 |
エ | 1 1 1 1 1 1 |
x_token = tokenizer("", prefix_text="アイウエ")
input_ids: | ... |
[
0.020129113,
-0.0004225266,
-0.010144261,
-0.01818721,
-0.0021701471,
-0.031273305,
-0.013658523,
-0.029737176,
0.0007821044,
0.04164944,
0.000063345025,
0.008470458,
-0.015520719,
-0.052982025,
-0.046489697,
-0.004804032,
-0.014115014,
-0.009455901,
-0.018201703,
0.005242409,
... | GPTSAN-japanese
Overview
The GPTSAN-japanese model was released in the repository by Toshiyuki Sakamoto (tanreinama).
GPTSAN is a Japanese language model using Switch Transformer. It has the same structure as the model introduced as Prefix LM
in the T5 paper, and support both Text Generation and Masked Language Modelin... |
[
-0.016786523,
-0.0006324142,
0.005179863,
-0.00023344702,
-0.0068110493,
-0.029248333,
0.0112111075,
0.0001749381,
-0.0039216275,
0.022964688,
-0.010306986,
0.02721406,
0.0107816495,
-0.022000292,
-0.013222778,
0.0058617215,
-0.01031452,
-0.00014527162,
-0.047285557,
-0.0165454... |
Spout Vector
A Spout Vector is a special vector for controlling text generation.
This vector is treated as the first embedding in self-attention to bring extraneous attention to the generated tokens.
In the pre-trained model published from Tanrei/GPTSAN-japanese, the Spout Vector is a 128-dimensional vector that pass... |
[
0.0071334243,
0.04015018,
-0.009741494,
-0.033834424,
-0.015606128,
-0.0011480795,
-0.025685966,
0.011701072,
0.022979213,
0.032142702,
-0.0016000862,
0.0058646332,
-0.0013463281,
-0.01965216,
-0.009755592,
0.0073025962,
-0.004165863,
-0.03859944,
-0.031212255,
0.003582572,
0... | Neighborhood Attention compared to other attention patterns.
Taken from the original paper.
This model was contributed by Ali Hassani.
The original code can be found here.
Usage tips |
[
0.022192782,
-0.03591997,
0.008127555,
-0.015579038,
-0.0057208873,
-0.050146867,
-0.04650196,
0.022442633,
-0.022222176,
0.069841124,
0.04797168,
-0.042474926,
0.030540794,
-0.04509103,
-0.038124554,
0.06002339,
0.010706915,
-0.026072843,
-0.037713032,
0.00048684495,
0.03142... | One can use the [AutoImageProcessor] API to prepare images for the model.
NAT can be used as a backbone. When output_hidden_states = True,
it will output both hidden_states and reshaped_hidden_states.
The reshaped_hidden_states have a shape of (batch, num_channels, height, width) rather than
(batch_size, height, width,... |
[
0.026204329,
0.036005042,
-0.023317412,
-0.01812096,
0.013302028,
0.008860616,
-0.018787172,
-0.0038899365,
-0.0058811693,
0.04272638,
-0.0004129125,
-0.027521947,
0.024590615,
-0.028454645,
0.021970183,
0.00641784,
0.014553025,
-0.036508404,
-0.013635134,
-0.018772367,
0.013... |
Neighborhood Attention Transformer
Overview
NAT was proposed in Neighborhood Attention Transformer
by Ali Hassani, Steven Walton, Jiachen Li, Shen Li, and Humphrey Shi.
It is a hierarchical vision transformer based on Neighborhood Attention, a sliding-window self attention pattern.
The abstract from the paper is the f... |
[
0.017484142,
-0.027293999,
0.0016163187,
-0.014673453,
-0.002683244,
-0.007030168,
-0.0015543182,
0.033507828,
-0.0017420419,
0.08999717,
0.023477525,
-0.008907406,
0.035987847,
-0.022278847,
-0.03452739,
0.037393194,
0.013791667,
-0.01730503,
-0.027266445,
-0.030090911,
0.01... | [NatForImageClassification] is supported by this example script and notebook.
See also: Image classification task guide
If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplic... |
[
0.029141726,
-0.0264062,
-0.008122837,
-0.02601541,
0.04251231,
0.0057152957,
-0.0045324597,
-0.021730684,
-0.014138203,
0.03966513,
0.056804035,
-0.03681795,
0.02688073,
-0.06665751,
0.019609256,
-0.009874412,
-0.009867433,
-0.031486463,
-0.039023116,
0.0018440377,
0.0121633... | ALBERT
Overview
The ALBERT model was proposed in ALBERT: A Lite BERT for Self-supervised Learning of Language Representations by Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma,
Radu Soricut. It presents two parameter-reduction techniques to lower memory consumption and increase the training... |
[
0.026530124,
0.031524207,
-0.004712884,
0.00462665,
-0.036923215,
0.024895424,
0.000018438994,
0.030114466,
0.034733616,
0.021596031,
-0.01774174,
-0.015792098,
0.04865106,
-0.0008829627,
-0.009065834,
0.04544165,
0.015132219,
-0.007258666,
-0.008383459,
0.010887999,
0.027130... | Notes:
- NAT depends on NATTEN's implementation of Neighborhood Attention.
You can install it with pre-built wheels for Linux by referring to shi-labs.com/natten,
or build on your system by running pip install natten.
Note that the latter will likely take time to compile. NATTEN does not support Windows devices yet.
- ... |
[
0.029496087,
0.0004982573,
-0.00991128,
-0.0053828503,
-0.008581355,
-0.00299233,
-0.0023013635,
-0.0020617542,
-0.039139897,
0.038872425,
0.05857611,
-0.011174336,
0.00097515405,
-0.055960838,
-0.018083999,
-0.010765701,
0.0019428784,
-0.021263931,
-0.044727065,
-0.0032096498,... |
ALBERT is a model with absolute position embeddings so it's usually advised to pad the inputs on the right rather
than the left.
ALBERT uses repeating layers which results in a small memory footprint, however the computational cost remains
similar to a BERT-like architecture with the same number of hidden layers ... |
[
0.043140594,
0.02012243,
-0.018910946,
0.027066292,
0.0051118652,
-0.012343825,
0.04358382,
-0.0030601013,
0.019753074,
0.02179191,
0.010312376,
-0.014700306,
0.011169277,
-0.05741245,
0.001640857,
-0.008857119,
0.017610818,
-0.041840468,
-0.049818523,
0.008842344,
0.02993248... |
This model was contributed by lysandre. This model jax version was contributed by
kamalkraj. The original code can be found here.
Resources
The resources provided in the following sections consist of a list of official Hugging Face and community (indicated by 🌎) resources to help you get started with AlBERT. If you'... |
[
0.02827985,
-0.01026811,
0.027201982,
0.022578496,
0.005690717,
0.023117429,
0.0016371891,
-0.0010060691,
0.007318156,
0.071479656,
0.028549317,
-0.012565671,
0.02822312,
-0.026946697,
-0.022153022,
-0.0024961152,
0.0071373293,
-0.052928984,
-0.031995658,
-0.040817156,
0.0190... | [AlbertForSequenceClassification] is supported by this example script.
[TFAlbertForSequenceClassification] is supported by this example script.
[FlaxAlbertForSequenceClassification] is supported by this example script and notebook.
Check the Text classification task guide on how to use the model.
[AlbertForTokenCla... |
[
0.03928198,
-0.0032747234,
0.0145469755,
0.02072889,
-0.026315399,
-0.012033046,
0.018273765,
0.03228414,
-0.009166285,
0.04410402,
0.025815552,
0.02216962,
0.03860572,
-0.03225474,
-0.034107108,
0.017950336,
0.015304095,
-0.051101856,
-0.016053863,
-0.019582184,
-0.006226017... | [AlbertForTokenClassification] is supported by this example script.
[TFAlbertForTokenClassification] is supported by this example script and notebook.
[FlaxAlbertForTokenClassification] is supported by this example script.
Token classification chapter of the 🤗 Hugging Face Course.
Check the Token classification tas... |
[
0.051909283,
-0.014244974,
-0.011917363,
0.0033875678,
-0.003221054,
0.00052595034,
0.043257736,
0.010477826,
0.0016875173,
0.05242494,
0.03242898,
0.020898357,
0.045148473,
-0.042341016,
-0.023562575,
0.032400332,
0.020053256,
-0.06967074,
-0.023906345,
-0.014030117,
0.01082... | Token classification chapter of the 🤗 Hugging Face Course.
Check the Token classification task guide on how to use the model.
[AlbertForMaskedLM] is supported by this example script and notebook.
[TFAlbertForMaskedLM] is supported by this example script and notebook.
[FlaxAlbertForMaskedLM] is supported by this examp... |
[
0.057182617,
-0.0226382,
-0.00882726,
-0.009032068,
0.008888702,
0.0012604275,
-0.0022528968,
-0.010336017,
-0.002382609,
0.018828755,
0.04754295,
-0.015756624,
-0.005560559,
-0.033370182,
0.018719524,
-0.003039704,
-0.0010411114,
-0.041617148,
-0.035582118,
-0.009844476,
-0.... |
The abstract from the paper is the following:
Increasing model size when pretraining natural language representations often results in improved performance on
downstream tasks. However, at some point further model increases become harder due to GPU/TPU memory limitations,
longer training times, and unexpected model d... |
[
0.06624123,
-0.0061956644,
0.00014281187,
0.021242278,
-0.06624123,
0.007391446,
0.023973428,
0.048842788,
-0.013446217,
0.0436984,
0.023698868,
0.014175969,
0.011134133,
-0.014912946,
-0.047831252,
0.00007846186,
0.014414403,
-0.053727068,
-0.015404264,
-0.0058813654,
0.0083... | [AlbertForQuestionAnswering] is supported by this example script and notebook.
[TFAlbertForQuestionAnswering] is supported by this example script and notebook.
[FlaxAlbertForQuestionAnswering] is supported by this example script.
Question answering chapter of the 🤗 Hugging Face Course.
Check the Question answering tas... |
[
0.06313076,
-0.012985844,
0.0063253846,
0.014620187,
-0.083098456,
-0.0050705653,
0.03211244,
0.046035126,
0.006783548,
0.07943316,
0.04652748,
0.008219581,
0.036023922,
0.004140563,
-0.04945425,
0.0195027,
0.0090333335,
-0.053639263,
-0.03774716,
-0.008376861,
0.0108386325,
... | Multiple choice
[AlbertForMultipleChoice] is supported by this example script and notebook.
[TFAlbertForMultipleChoice] is supported by this example script and notebook.
Check the Multiple choice task guide on how to use the model. |
[
0.03988578,
0.004404055,
-0.037697602,
0.03542633,
-0.01761622,
-0.008655769,
-0.003995503,
0.02679826,
-0.0020756533,
0.046699602,
0.013336808,
0.004462914,
0.01582967,
-0.072514564,
-0.0015433235,
0.0026278913,
-0.008572673,
-0.04761365,
-0.08758253,
-0.005193461,
0.0015987... | Check the Multiple choice task guide on how to use the model.
AlbertConfig
[[autodoc]] AlbertConfig
AlbertTokenizer
[[autodoc]] AlbertTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
- save_vocabulary
AlbertTokenizerFast
[[autodoc]] AlbertTo... |
[
0.02101188,
-0.033142023,
0.005225557,
0.011787486,
-0.01620094,
-0.017722348,
0.0049480028,
0.026480723,
-0.011225524,
0.060088765,
0.043750763,
0.024438474,
0.044161953,
-0.014679532,
-0.044271603,
0.048164215,
-0.0005632465,
-0.0504943,
-0.033882167,
-0.023684623,
0.021039... |
TFAlbertModel
[[autodoc]] TFAlbertModel
- call
TFAlbertForPreTraining
[[autodoc]] TFAlbertForPreTraining
- call
TFAlbertForMaskedLM
[[autodoc]] TFAlbertForMaskedLM
- call
TFAlbertForSequenceClassification
[[autodoc]] TFAlbertForSequenceClassification
- call
TFAlbertForMultipleChoice
[[autodoc]] TFAlbe... |
[
0.0072777006,
-0.033313222,
-0.006550626,
-0.003604062,
-0.007326404,
-0.0012045429,
0.00236734,
0.042469487,
0.012050647,
0.05955747,
0.053212095,
0.040604837,
0.034454275,
-0.011013958,
-0.03996473,
0.049510628,
-0.015515557,
-0.06874157,
-0.04160674,
-0.006195786,
0.029333... |
FlaxAlbertModel
[[autodoc]] FlaxAlbertModel
- call
FlaxAlbertForPreTraining
[[autodoc]] FlaxAlbertForPreTraining
- call
FlaxAlbertForMaskedLM
[[autodoc]] FlaxAlbertForMaskedLM
- call
FlaxAlbertForSequenceClassification
[[autodoc]] FlaxAlbertForSequenceClassification
- call
FlaxAlbertForMultipleChoice
... |
[
0.017474994,
-0.00801748,
-0.02110751,
0.0091137225,
-0.020809125,
-0.00016125369,
0.015023046,
0.025025437,
0.005250931,
0.050206553,
0.043304775,
0.0374668,
0.022352943,
-0.026595203,
-0.028878499,
0.02538869,
-0.012811104,
-0.058068357,
-0.041410677,
-0.027607119,
0.009314... | AlbertModel
[[autodoc]] AlbertModel
- forward
AlbertForPreTraining
[[autodoc]] AlbertForPreTraining
- forward
AlbertForMaskedLM
[[autodoc]] AlbertForMaskedLM
- forward
AlbertForSequenceClassification
[[autodoc]] AlbertForSequenceClassification
- forward
AlbertForMultipleChoice
[[autodoc]] AlbertForMulti... |
[
-0.013170788,
-0.019777821,
-0.015983826,
-0.02805825,
-0.029284446,
0.002930248,
-0.020527964,
-0.0207155,
-0.02941428,
0.0639353,
-0.016084807,
-0.026933035,
0.046710856,
-0.015767438,
0.0058424636,
-0.0012938172,
-0.010415453,
-0.019720117,
-0.061338652,
0.0012126717,
0.00... |
ViTDet
Overview
The ViTDet model was proposed in Exploring Plain Vision Transformer Backbones for Object Detection by Yanghao Li, Hanzi Mao, Ross Girshick, Kaiming He.
VitDet leverages the plain Vision Transformer for the task of object detection.
The abstract from the paper is the following:
We explore the plain, non... |
[
0.018851146,
0.02295644,
-0.032057516,
0.002769564,
0.021250933,
0.011583871,
-0.03501574,
-0.022775324,
0.011659336,
0.057685416,
-0.0061277547,
-0.024239345,
0.023937484,
-0.049112596,
0.00052778306,
0.015145817,
-0.021039631,
-0.022594208,
-0.027695639,
-0.014217598,
-0.01... |
Speech2Text
Overview
The Speech2Text model was proposed in fairseq S2T: Fast Speech-to-Text Modeling with fairseq by Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, Juan Pino. It's a
transformer-based seq2seq (encoder-decoder) model designed for end-to-end Automatic Speech Recognition (ASR) and Speech
Tran... |
[
-0.023944747,
-0.047555767,
-0.021580864,
0.0010741764,
-0.040936895,
0.039741047,
-0.014433593,
0.028867185,
0.005280498,
0.05044805,
-0.016658423,
-0.036542855,
0.032482535,
-0.020857792,
-0.011005962,
0.029701497,
-0.013640997,
-0.0073558483,
-0.059847962,
0.021970209,
0.0... | At the moment, only the backbone is available.
VitDetConfig
[[autodoc]] VitDetConfig
VitDetModel
[[autodoc]] VitDetModel
- forward |
[
0.002991961,
0.009669483,
-0.033947323,
0.008494269,
-0.0062554115,
-0.054119352,
0.00034284825,
-0.004559533,
0.007780215,
0.040849846,
-0.016185226,
0.038380407,
0.035553943,
-0.032578718,
-0.02908283,
0.013708351,
-0.027148932,
-0.012243053,
-0.0153670395,
-0.017077794,
-0... | Multilingual speech translation
For multilingual speech translation models, eos_token_id is used as the decoder_start_token_id and
the target language id is forced as the first generated token. To force the target language id as the first
generated token, pass the forced_bos_token_id parameter to the generate() me... |
[
0.029133817,
0.022578064,
-0.039823946,
-0.015597283,
-0.009157447,
-0.003854242,
-0.020968106,
0.0012791124,
-0.026532125,
0.011668983,
0.022462148,
0.029803561,
-0.012686477,
-0.051183816,
-0.017902743,
0.02864439,
-0.03577973,
-0.040596727,
-0.02162497,
-0.05450677,
-0.003... | ASR and Speech Translation
thon |
[
0.02250438,
0.016719647,
-0.016247423,
-0.014749591,
-0.00007222845,
-0.003925354,
-0.01894795,
-0.012845943,
0.006814031,
0.0069173295,
0.00681772,
-0.026975742,
0.06103483,
-0.06522581,
-0.022961846,
0.0012294401,
-0.036449715,
-0.06587511,
-0.037807357,
-0.02654779,
-0.018... |
import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset
model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")
ds ... |
[
0.0056918594,
0.0034690637,
-0.029391438,
0.027533986,
-0.00074562675,
-0.01800089,
-0.004230482,
0.0015723463,
0.0025949688,
0.037094396,
0.009314572,
-0.0025676533,
0.04056346,
-0.018219413,
-0.0011446886,
0.027998349,
-0.020459281,
-0.053838775,
-0.0262365,
-0.017222399,
-... | Speech2TextModel
[[autodoc]] Speech2TextModel
- forward
Speech2TextForConditionalGeneration
[[autodoc]] Speech2TextForConditionalGeneration
- forward
TFSpeech2TextModel
[[autodoc]] TFSpeech2TextModel
- call
TFSpeech2TextForConditionalGeneration
[[autodoc]] TFSpeech2TextForConditionalGeneration
- call |
[
0.012884455,
0.02726592,
-0.022789424,
0.0080809435,
-0.006580301,
-0.010268322,
-0.015464253,
-0.021176143,
-0.0030812232,
0.016801387,
-0.0018476439,
-0.024693388,
0.07540277,
-0.05528761,
-0.013865504,
0.015784003,
-0.031655207,
-0.06749623,
-0.041451175,
-0.033631843,
-0.... |
import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset
model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-medium-mustc-multilingual-st")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-medium-mustc-multili... |
[
0.048001036,
-0.011559465,
-0.010024282,
0.018437384,
-0.0009585388,
-0.04027953,
-0.011361867,
0.008200304,
-0.02220694,
0.06912879,
-0.018133387,
-0.0063649253,
0.008823496,
-0.03556758,
0.0037220565,
-0.006072329,
0.028910061,
-0.029244458,
-0.058336917,
-0.022814933,
0.01... |
CLIPSeg
Overview
The CLIPSeg model was proposed in Image Segmentation Using Text and Image Prompts by Timo Lüddecke
and Alexander Ecker. CLIPSeg adds a minimal decoder on top of a frozen CLIP model for zero- and one-shot image segmentation.
The abstract from the paper is the following:
Image segmentation is usually ad... |
[
-0.00062756945,
-0.007504483,
-0.01856446,
0.04325618,
-0.003660895,
-0.033643693,
-0.02314585,
-0.017285608,
0.020517875,
0.03985527,
0.0076169097,
0.0041914084,
0.028022358,
-0.05567933,
-0.015388407,
0.044802047,
-0.025197638,
-0.038871538,
-0.040473618,
-0.011390232,
-0.0... |
See the model hub to look for Speech2Text checkpoints.
Speech2TextConfig
[[autodoc]] Speech2TextConfig
Speech2TextTokenizer
[[autodoc]] Speech2TextTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
- save_vocabulary
Speech2TextFeatureExtractor... |
[
0.01204488,
-0.023700751,
-0.0047581596,
-0.002669036,
0.004750956,
-0.047516763,
-0.010071018,
0.02217353,
-0.0130966455,
0.05561392,
-0.025674613,
-0.00042818036,
0.02256254,
-0.042070635,
0.0077297585,
0.0049994895,
0.00531646,
-0.042445235,
-0.037460152,
-0.035241358,
-0.... | [CLIPSegForImageSegmentation] adds a decoder on top of [CLIPSegModel]. The latter is identical to [CLIPModel].
[CLIPSegForImageSegmentation] can generate image segmentations based on arbitrary prompts at test time. A prompt can be either a text
(provided to the model as input_ids) or an image (provided to the model as ... |
[
0.006612049,
0.009064339,
-0.024677489,
-0.00033683857,
0.0039173407,
0.023974827,
-0.013561376,
-0.021754414,
0.011073953,
0.0854437,
0.028303225,
-0.014854274,
0.013758121,
-0.05348663,
0.020686368,
0.016695248,
-0.021754414,
-0.013975946,
-0.06284609,
-0.005389417,
0.02407... |
Autoformer
Overview
The Autoformer model was proposed in Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting by Haixu Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long.
This model augments the Transformer as a deep decomposition architecture, which can progressively decompose the tr... |
[
-0.0063206595,
0.01422997,
-0.053986985,
-0.015248336,
-0.011738367,
0.013503536,
0.018466374,
0.016864143,
0.042798534,
0.07114985,
0.018819407,
-0.023015076,
0.016022295,
-0.033999853,
0.01186736,
0.020937609,
0.003560887,
-0.012722788,
-0.055236183,
0.023503892,
0.01372078... | Check out the Autoformer blog-post in HuggingFace blog: Yes, Transformers are Effective for Time Series Forecasting (+ Autoformer)
AutoformerConfig
[[autodoc]] AutoformerConfig
AutoformerModel
[[autodoc]] AutoformerModel
- forward
AutoformerForPrediction
[[autodoc]] AutoformerForPrediction
- forward |
[
0.05089044,
0.003967465,
-0.0033699328,
0.032036632,
0.0010521762,
-0.04064703,
0.011037644,
0.019892996,
-0.015424495,
0.053562634,
-0.034679133,
0.01406613,
0.026647707,
-0.053117268,
0.007278016,
0.008046271,
0.05023724,
-0.04432872,
-0.040112592,
-0.013026943,
0.000373457... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with CLIPSeg. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of dupli... |
[
0.00180557,
-0.045297924,
-0.01113741,
0.010716501,
-0.027352463,
-0.002986456,
-0.008304619,
0.047890194,
-0.009727696,
0.056869607,
-0.004142288,
0.0034775177,
0.022983018,
-0.02251534,
0.016462255,
0.037654735,
0.013883347,
-0.030786555,
-0.059488602,
-0.009487176,
-0.0076... |
CLIPSegConfig
[[autodoc]] CLIPSegConfig
- from_text_vision_configs
CLIPSegTextConfig
[[autodoc]] CLIPSegTextConfig
CLIPSegVisionConfig
[[autodoc]] CLIPSegVisionConfig
CLIPSegProcessor
[[autodoc]] CLIPSegProcessor
CLIPSegModel
[[autodoc]] CLIPSegModel
- forward
- get_text_features
- get_image_features
... |
[
0.0040640733,
-0.005307761,
-0.022100946,
-0.013544645,
-0.0062422263,
-0.01317086,
-0.022644635,
0.0060043624,
-0.013143675,
0.06660187,
0.020836871,
-0.0073330016,
0.023120362,
-0.049231015,
0.007897079,
-0.026572786,
0.027836863,
-0.026681524,
-0.054124214,
0.01409513,
0.0... | Conditional DETR shows much faster convergence compared to the original DETR. Taken from the original paper.
This model was contributed by DepuMeng. The original code can be found here.
Resources
Object detection task guide |
[
-0.0135018965,
-0.022040265,
0.00159321,
-0.016650505,
-0.01385938,
-0.0034493771,
-0.013034417,
0.010112673,
0.00012804115,
0.060882278,
0.016788,
-0.015495557,
0.0380583,
-0.023965178,
-0.0201566,
0.02193027,
-0.011150751,
-0.03937824,
-0.048892815,
0.0021947457,
-0.0179841... |
ConditionalDetrConfig
[[autodoc]] ConditionalDetrConfig
ConditionalDetrImageProcessor
[[autodoc]] ConditionalDetrImageProcessor
- preprocess
- post_process_object_detection
- post_process_instance_segmentation
- post_process_semantic_segmentation
- post_process_panoptic_segmentation
ConditionalDet... |
[
0.00727653,
-0.03817721,
-0.0038657703,
-0.031042645,
0.035265144,
-0.036983263,
0.031974506,
-0.021913312,
-0.022976216,
0.058561686,
0.010905694,
-0.02099601,
0.032789886,
-0.018214986,
0.0016980997,
-0.03424592,
-0.013104306,
-0.031392094,
-0.075480804,
-0.017035598,
0.001... |
VisualBERT
Overview
The VisualBERT model was proposed in VisualBERT: A Simple and Performant Baseline for Vision and Language by Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, Kai-Wei Chang.
VisualBERT is a neural network trained on a variety of (image, text) pairs.
The abstract from the paper is the followin... |
[
0.014271211,
-0.039941717,
-0.0026620447,
0.03066322,
-0.03502264,
-0.0504868,
0.004318919,
-0.0023711713,
-0.0054345476,
0.066039324,
-0.019455386,
0.0113035645,
0.044153858,
-0.032607287,
-0.004690795,
0.00773208,
-0.030162476,
-0.026671994,
-0.08029581,
-0.0037298081,
-0.0... | Most of the checkpoints provided work with the [VisualBertForPreTraining] configuration. Other
checkpoints provided are the fine-tuned checkpoints for down-stream tasks - VQA ('visualbert-vqa'), VCR
('visualbert-vcr'), NLVR2 ('visualbert-nlvr2'). Hence, if you are not working on these downstream tasks, it is
r... |
[
0.01129347,
-0.008935416,
-0.026225481,
0.003600056,
-0.007375042,
-0.063758425,
-0.04931622,
-0.00068747427,
-0.03560172,
0.014456201,
0.023524564,
-0.0062659867,
0.032243066,
-0.024742076,
-0.0026939195,
-0.005898634,
-0.0025837137,
-0.031767257,
-0.056285422,
-0.020487782,
... | For the VCR task, the authors use a fine-tuned detector for generating visual embeddings, for all the checkpoints.
We do not provide the detector and its weights as a part of the package, but it will be available in the research
projects, and the states can be loaded directly into the detector provided. |
[
-0.010408201,
0.018251209,
-0.036354993,
-0.033524435,
-0.02304252,
-0.011985648,
-0.011683428,
-0.004161069,
-0.023661705,
0.07394835,
0.025357092,
-0.0021579328,
0.031431,
-0.037534393,
0.006092336,
-0.03296422,
-0.007139053,
-0.021730438,
-0.05168719,
-0.004997706,
0.00254... |
Conditional DETR
Overview
The Conditional DETR model was proposed in Conditional DETR for Fast Training Convergence by Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, Jingdong Wang. Conditional DETR presents a conditional cross-attention mechanism for fast DETR training. Conditional D... |
[
0.027513647,
-0.019255318,
-0.0044503217,
-0.020991685,
0.025974916,
-0.0076724817,
-0.008223037,
-0.0035874322,
-0.01699663,
0.04604901,
-0.0043585626,
-0.020299962,
0.03633665,
-0.016064921,
-0.0012952166,
-0.02670899,
0.005244392,
-0.037578925,
-0.04644428,
-0.009070045,
-... |
VisualBERT is a multi-modal vision and language model. It can be used for visual question answering, multiple choice,
visual reasoning and region-to-phrase correspondence tasks. VisualBERT uses a BERT-like transformer to prepare
embeddings for image-text pairs. Both the text and visual features are then projected to ... |
[
0.012468835,
-0.033885643,
-0.011764662,
-0.015164607,
-0.007194653,
-0.043217707,
-0.0031723334,
0.028963547,
-0.026203759,
0.04805445,
-0.00007874153,
-0.00058858877,
0.045977496,
0.0019631481,
-0.011487261,
0.0006228194,
0.016971273,
-0.031581078,
-0.056333814,
-0.0095383385... | VisualBERT VQA demo notebook : This notebook
contains an example on VisualBERT VQA.
Generate Embeddings for VisualBERT (Colab Notebook) : This notebook contains
an example on how to generate visual embeddings.
The following example shows how to get the last hidden state using [VisualBertModel]:
thon |
[
0.022952348,
-0.017142355,
-0.019860396,
-0.027956994,
0.009031375,
-0.0024286201,
-0.022175765,
0.0072445148,
-0.010534207,
0.044926777,
0.014683175,
-0.01866676,
0.048982266,
-0.027683754,
0.0008287149,
0.0051700305,
-0.015761763,
-0.059768144,
-0.03160981,
0.0054217014,
-0... |
import torch
from transformers import BertTokenizer, VisualBertModel
model = VisualBertModel.from_pretrained("uclanlp/visualbert-vqa-coco-pre")
tokenizer = BertTokenizer.from_pretrained("google-bert/bert-base-uncased")
inputs = tokenizer("What is the man eating?", return_tensors="pt")
this is a custom function that r... |
[
0.05389323,
0.0010040373,
-0.014751491,
0.00418378,
0.026904708,
-0.019906132,
-0.009631773,
-0.021917697,
0.014639737,
0.047551207,
0.005091779,
-0.006464254,
0.009513035,
-0.046238102,
-0.017042441,
-0.02292348,
-0.005741347,
-0.035314176,
-0.010504849,
-0.011175372,
0.0135... |
BigBirdPegasus
Overview
The BigBird model was proposed in Big Bird: Transformers for Longer Sequences by
Zaheer, Manzil and Guruganesh, Guru and Dubey, Kumar Avinava and Ainslie, Joshua and Alberti, Chris and Ontanon,
Santiago and Pham, Philip and Ravula, Anirudh and Wang, Qifan and Yang, Li and others. BigBird, is a ... |
[
-0.00036971644,
-0.041473173,
-0.016444372,
-0.025889976,
-0.035458606,
-0.009568629,
0.0056318217,
0.02917065,
-0.0043366393,
0.05795855,
0.011625884,
0.003964146,
0.028213786,
0.0024980956,
-0.015924932,
0.025903646,
-0.03947743,
-0.030209528,
-0.086281694,
-0.007039777,
-0... |
VisualBertConfig
[[autodoc]] VisualBertConfig
VisualBertModel
[[autodoc]] VisualBertModel
- forward
VisualBertForPreTraining
[[autodoc]] VisualBertForPreTraining
- forward
VisualBertForQuestionAnswering
[[autodoc]] VisualBertForQuestionAnswering
- forward
VisualBertForMultipleChoice
[[autodoc]] VisualBert... |
[
0.04918946,
0.018027551,
-0.0011061548,
0.0077475547,
0.0002445702,
-0.019358156,
0.0021908483,
0.0028221703,
0.03671325,
0.046785787,
-0.0047572707,
0.0033318778,
0.017927399,
-0.007912092,
-0.0014191332,
-0.020917682,
-0.014050044,
-0.0373714,
-0.009907999,
0.007293289,
-0.... |
For an in-detail explanation on how BigBird's attention works, see this blog post.
BigBird comes with 2 implementations: original_full & block_sparse. For the sequence length < 1024, using
original_full is advised as there is no benefit in using block_sparse attention.
The code currently uses window size of 3 block... |
[
0.014233348,
-0.0072096153,
-0.034175966,
0.004530905,
0.0055233887,
0.0012630104,
-0.013011829,
-0.025412899,
-0.00047425128,
0.048621755,
-0.014047464,
-0.013264099,
0.011325602,
-0.045541402,
0.009944755,
-0.014034187,
-0.023886,
-0.015680581,
-0.056296077,
-0.021721788,
-... | Resources
Text classification task guide
Question answering task guide
Causal language modeling task guide
Translation task guide
Summarization task guide |
[
0.027618296,
-0.0036375318,
-0.017123343,
0.030770823,
-0.0022902978,
-0.012812195,
-0.002852768,
0.063535556,
0.0075108293,
0.0367256,
0.007652289,
0.017150288,
0.04162953,
0.0014112276,
-0.029450534,
0.019979479,
-0.021919496,
-0.02585342,
-0.05728439,
-0.02982776,
-0.01954... |
BigBirdPegasusConfig
[[autodoc]] BigBirdPegasusConfig
- all
BigBirdPegasusModel
[[autodoc]] BigBirdPegasusModel
- forward
BigBirdPegasusForConditionalGeneration
[[autodoc]] BigBirdPegasusForConditionalGeneration
- forward
BigBirdPegasusForSequenceClassification
[[autodoc]] BigBirdPegasusForSequenceClassif... |
[
0.036230005,
0.018294908,
-0.027995914,
-0.022529583,
0.015250369,
-0.0017367707,
-0.009479585,
-0.027082551,
-0.006947083,
0.08319893,
0.07417602,
0.0041827806,
0.037198722,
-0.03733711,
0.012496446,
0.006954002,
0.020066274,
-0.029615054,
-0.05059469,
-0.01081503,
0.0144892... |
EfficientNet
Overview
The EfficientNet model was proposed in EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
by Mingxing Tan and Quoc V. Le. EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster t... |
[
0.025324563,
0.0021985099,
0.00063479977,
0.004322494,
-0.03676604,
-0.005188412,
0.0062637124,
0.019688996,
-0.014216675,
0.06876243,
0.038497876,
0.025665252,
-0.0006751679,
-0.01484837,
-0.037248682,
0.0068776626,
-0.024231518,
-0.041706033,
-0.011114985,
0.015302622,
0.08... | FLAN-UL2
Overview
Flan-UL2 is an encoder decoder model based on the T5 architecture. It uses the same configuration as the UL2 model released earlier last year.
It was fine tuned using the "Flan" prompt tuning and dataset collection. Similar to Flan-T5, one can directly use FLAN-UL2 weights without finetuning the mod... |
[
0.032461524,
-0.037497662,
0.01100037,
0.032864414,
0.00055892166,
-0.024547588,
0.017309934,
-0.00051980163,
0.031454295,
0.062217917,
0.021813683,
-0.009431972,
0.029871508,
-0.065901496,
-0.011611901,
0.04866351,
0.0023112288,
-0.027641216,
-0.045728154,
-0.0050217514,
0.0... | The original checkpoints can be found here.
Running on low resource devices
The model is pretty heavy (~40GB in half precision) so if you just want to run the model, make sure you load your model in 8bit, and use device_map="auto" to make sure you don't have any OOM issue!
thon |
[
0.015343609,
0.010534004,
-0.009196463,
0.01145573,
-0.028081438,
-0.0096885115,
-0.012855643,
0.019931445,
0.036259152,
0.064922735,
0.017450409,
0.001379123,
0.0113309845,
-0.06847103,
-0.017339526,
0.039668843,
-0.018198878,
-0.07401524,
-0.03523347,
-0.014484256,
0.034540... | from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-ul2", load_in_8bit=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2")
inputs = tokenizer("A step by step recipe to make bolognese pasta:", return_tensors="pt")
outp... |
[
0.022770826,
-0.010350375,
-0.01029123,
0.02980908,
-0.046487972,
-0.026541319,
-0.00082433346,
0.006827551,
0.0045837373,
0.07682936,
0.042377394,
0.0054191607,
0.017181622,
-0.0156142805,
-0.03525042,
0.041697226,
-0.011414985,
-0.018778538,
-0.013588564,
-0.012309553,
0.04... |
The original UL2 model was only trained with receptive field of 512, which made it non-ideal for N-shot prompting where N is large.
The Flan-UL2 checkpoint uses a receptive field of 2048 which makes it more usable for few-shot in-context learning.
The original UL2 model also had mode switch tokens that was rather man... |
[
0.018681418,
0.006369662,
0.0038188735,
0.025274,
-0.019441538,
-0.011745321,
0.013587151,
-0.0072028707,
0.037392072,
0.052097477,
-0.03797678,
0.0044839787,
0.01308284,
0.0028084253,
-0.011664923,
-0.013170546,
0.0064610224,
-0.017643562,
-0.03911696,
0.013674856,
-0.022145... | Refer to T5's documentation page for API reference, tips, code examples and notebooks. |
[
0.03878542,
0.004827205,
-0.0476219,
-0.028355023,
-0.016722193,
-0.012590581,
0.008766567,
0.012338909,
0.007843771,
0.076004885,
-0.00016111802,
-0.011653802,
0.060736794,
-0.023000006,
-0.0048411866,
-0.0031651224,
-0.006110032,
-0.056933753,
-0.063253514,
0.023223715,
0.0... | Nougat high-level overview. Taken from the original paper.
This model was contributed by nielsr. The original code can be found
here.
Usage tips
The quickest way to get started with Nougat is by checking the tutorial
notebooks, which show how to use the model
at inference time as well as fine-tuning on custom dat... |
[
0.01659393,
0.012743562,
-0.019524803,
-0.0066519384,
-0.020200055,
-0.0349119,
-0.016550828,
0.015027922,
0.0001947407,
0.048330713,
0.0013505016,
-0.0038036732,
0.024423964,
-0.023791814,
-0.0033223776,
0.0048309164,
-0.0011978517,
-0.042698838,
-0.03425102,
-0.020156953,
0... |
Inference
Nougat's [VisionEncoderDecoder] model accepts images as input and makes use of
[~generation.GenerationMixin.generate] to autoregressively generate text given the input image.
The [NougatImageProcessor] class is responsible for preprocessing the input image and
[NougatTokenizerFast] decodes the generated tar... |
[
0.024504844,
0.002765629,
-0.030086583,
0.0052464018,
-0.021000031,
-0.023120226,
0.009050494,
-0.00847357,
0.015014445,
0.04269237,
0.00879809,
-0.0017587165,
0.059423164,
-0.041884676,
-0.010341361,
0.008812513,
-0.005383421,
-0.063807786,
-0.039634675,
-0.02793754,
0.00866... |
from huggingface_hub import hf_hub_download
import re
from PIL import Image
from transformers import NougatProcessor, VisionEncoderDecoderModel
from datasets import load_dataset
import torch
processor = NougatProcessor.from_pretrained("facebook/nougat-base")
model = VisionEncoderDecoderModel.from_pretrained("facebook... |
[
0.032340776,
0.002440876,
0.013086826,
-0.0028537938,
-0.008498112,
-0.00059273664,
-0.02284367,
-0.010309622,
0.021764757,
0.026639849,
0.021524997,
0.006563393,
0.012174411,
-0.035431,
-0.026400091,
0.008025254,
-0.01958029,
-0.06857097,
-0.030662466,
-0.025774054,
-0.02434... | Step-by-step PDF transcription |
[
0.027630806,
-0.007552142,
-0.01418465,
-0.0037377528,
0.01893609,
-0.0013411322,
0.011397881,
-0.014630533,
0.00053035683,
0.06448582,
0.008137363,
-0.019159032,
0.039237697,
-0.012442919,
-0.014296121,
-0.0006505362,
-0.00219458,
-0.03642306,
-0.03363629,
-0.009133632,
0.00... |
Nougat
Overview
The Nougat model was proposed in Nougat: Neural Optical Understanding for Academic Documents by
Lukas Blecher, Guillem Cucurull, Thomas Scialom, Robert Stojnic. Nougat uses the same architecture as Donut, meaning an image Transformer
encoder and an autoregressive text Transformer decoder to translate s... |
[
0.04125409,
-0.009111015,
-0.018826973,
0.032135695,
-0.009479882,
-0.03552927,
-0.0071265106,
0.013544797,
-0.02821095,
0.02376979,
-0.02732567,
0.01339725,
0.0074363593,
-0.052998815,
-0.006720757,
0.02219104,
-0.015772754,
-0.01733675,
-0.028845401,
0.013684967,
0.02266319... |
LLaVa
Overview
LLaVa is an open-source chatbot trained by fine-tuning LlamA/Vicuna on GPT-generated multimodal instruction-following data. It is an auto-regressive language model, based on the transformer architecture. In other words, it is an multi-modal version of LLMs fine-tuned for chat / instructions.
The LLaVa m... |
[
0.011023168,
-0.028178798,
-0.033853404,
0.012868457,
0.0029309557,
-0.042344503,
-0.0047970554,
-0.009698168,
0.016163614,
0.065209426,
-0.0036871075,
0.007866754,
0.057384297,
-0.05372147,
-0.014193457,
0.033437174,
-0.0031772254,
-0.02036754,
-0.04647906,
0.017231937,
0.03... | See the model hub to look for Nougat checkpoints.
The model is identical to Donut in terms of architecture.
NougatImageProcessor
[[autodoc]] NougatImageProcessor
- preprocess
NougatTokenizerFast
[[autodoc]] NougatTokenizerFast
NougatProcessor
[[autodoc]] NougatProcessor
- call
- from_pretrained
- save... |
[
0.045656268,
-0.024946786,
-0.016500236,
-0.007885317,
-0.022996504,
-0.053597707,
-0.0056965104,
0.026686609,
0.011084343,
0.06841425,
0.031008098,
-0.014276353,
-0.006587467,
-0.02982951,
-0.038556676,
0.016991315,
0.011842007,
-0.03914597,
-0.035133157,
-0.021733731,
0.047... | Note the model has not been explicitly trained to process multiple images in the same prompt, although this is technically possible, you may experience inaccurate results.
For better results, we recommend users to prompt the model with the correct prompt format:
"USER: <image>\n<prompt>ASSISTANT:"
For multiple turns... |
[
0.029098747,
0.0007877571,
-0.015197793,
-0.015897213,
-0.028005904,
-0.048201628,
0.015838927,
0.035145808,
-0.0096607255,
0.040012598,
-0.016654916,
-0.019714875,
0.0143818045,
-0.034096677,
-0.011278132,
0.004560795,
-0.01811204,
-0.028005904,
-0.0007399453,
0.00059468835,
... | "USER: <image>\n<prompt>ASSISTANT:"
For multiple turns conversation:
"USER: <image>\n<prompt1>ASSISTANT: <answer1>USER: <prompt2>ASSISTANT: <answer2>USER: <prompt3>ASSISTANT:"
Using Flash Attention 2
Flash Attention 2 is an even faster, optimized version of the previous optimization, please refer to the Flash Attentio... |
[
0.023664616,
-0.010438509,
0.023799501,
-0.00017609831,
-0.040824838,
-0.029149892,
0.024383998,
0.0064369556,
-0.021581411,
0.05089616,
-0.05173544,
0.0011586895,
0.009269516,
-0.008677525,
-0.033720955,
0.01808942,
-0.010273651,
-0.041903906,
-0.03764757,
0.049547322,
0.018... | LLaVa architecture. Taken from the original paper.
This model was contributed by ArthurZ and ybelkada.
The original code can be found here.
Usage tips
We advise users to use padding_side="left" when computing batched generation as it leads to more accurate results. Simply make sure to call processor.tokenizer.padding... |
[
0.043717314,
-0.015827723,
-0.028959593,
0.00792081,
-0.048858892,
0.026374908,
0.02292866,
0.017773185,
-0.012638556,
0.05869737,
-0.013729404,
-0.013375052,
0.012145242,
-0.03157207,
-0.004286965,
0.05138799,
-0.006413077,
-0.037519626,
-0.008150096,
0.027472705,
0.02395697... | A Google Colab demo on how to run Llava on a free-tier Google colab instance leveraging 4-bit inference.
A similar notebook showcasing batched inference. 🌎
LlavaConfig
[[autodoc]] LlavaConfig
LlavaProcessor
[[autodoc]] LlavaProcessor
LlavaForConditionalGeneration
[[autodoc]] LlavaForConditionalGeneration
- forwar... |
[
0.058578655,
-0.00963092,
-0.0186245,
0.024785457,
0.009914183,
-0.016698316,
0.0005528042,
-0.040223256,
0.0021935129,
0.031923667,
0.01603265,
-0.023312492,
0.019502614,
-0.063054204,
0.011833285,
0.04050652,
0.006440678,
-0.029572591,
-0.027547264,
-0.005006662,
0.00212623... |
MegatronGPT2
Overview
The MegatronGPT2 model was proposed in Megatron-LM: Training Multi-Billion Parameter Language Models Using Model
Parallelism by Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley,
Jared Casper and Bryan Catanzaro.
The abstract from the paper is the following:
Recent work in language ... |
[
0.040179785,
0.019772444,
0.010256577,
0.047193862,
-0.017837526,
-0.03936349,
0.012516501,
-0.017127048,
0.033044774,
0.06173598,
0.000656625,
-0.00993913,
0.05753358,
-0.070443116,
-0.032500576,
0.08042003,
0.029054005,
-0.021541081,
-0.015328179,
-0.005740509,
0.021299215,... | wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/megatron_lm_345m/versions/v0.0/zip -O
megatron_gpt2_345m_v0_0.zip
Once you have obtained the checkpoint from NVIDIA GPU Cloud (NGC), you have to convert it to a format that will easily
be loaded by Hugging Face Transformers GPT2 implementation.
The ... |
[
0.009673071,
-0.00862022,
-0.003502193,
0.023542926,
-0.023952367,
-0.017810734,
-0.013299559,
0.0030653328,
-0.04439523,
0.048255686,
0.027110921,
-0.008861499,
0.022811778,
-0.024522662,
-0.023879252,
0.014169624,
-0.0073370575,
-0.027315643,
-0.05790682,
0.0074869427,
0.02... | A notebook on fine-tuning OPT with PEFT, bitsandbytes, and Transformers. 🌎
A blog post on decoding strategies with OPT.
Causal language modeling chapter of the 🤗 Hugging Face Course.
[OPTForCausalLM] is supported by this causal language modeling example script and notebook.
[TFOPTForCausalLM] is supported by this cau... |
[
0.03877709,
-0.0063870344,
-0.044355027,
-0.0030611532,
-0.015391523,
-0.027785277,
-0.012714412,
-0.003087253,
-0.0110291,
0.04247583,
0.028396763,
-0.0061372207,
0.023832997,
-0.024265511,
-0.012856097,
0.028441506,
-0.0072446046,
0.0030052245,
-0.07916492,
0.007404933,
0.0... |
OPT
Overview
The OPT model was proposed in Open Pre-trained Transformer Language Models by Meta AI.
OPT is a series of open-sourced large causal language models which perform similar in performance to GPT3.
The abstract from the paper is the following:
Large language models, which are often trained for hundreds of tho... |
[
0.040766966,
0.0133228125,
-0.0039120875,
0.015592313,
-0.025889125,
-0.013848159,
-0.01605462,
-0.0036459116,
0.025174651,
0.05612112,
-0.000023134442,
-0.005376056,
0.032865737,
-0.057550065,
-0.04561417,
0.09027571,
0.008146388,
-0.0034585376,
-0.0053690514,
-0.0016881166,
... | python3 $PATH_TO_TRANSFORMERS/models/megatron_gpt2/convert_megatron_gpt2_checkpoint.py megatron_gpt2_345m_v0_0.zip
MegatronGPT2 architecture is the same as OpenAI GPT-2 . Refer to GPT-2 documentation for information on
configuration classes and their parameters. |
[
0.043854926,
-0.0019288722,
-0.06919852,
-0.012029447,
-0.013919997,
0.015810547,
-0.040555585,
0.01667188,
0.024175685,
0.05652672,
-0.0026989612,
-0.018613525,
0.018277751,
-0.02890571,
0.0034398525,
0.03962126,
-0.019241275,
-0.040234413,
-0.019255875,
0.014752131,
0.02395... | ⚡️ Inference
A blog post on How 🤗 Accelerate runs very large models thanks to PyTorch with OPT.
Combining OPT and Flash Attention 2
First, make sure to install the latest version of Flash Attention 2 to include the sliding window attention feature. |
[
0.033325292,
-0.014030923,
-0.012219766,
0.0154946335,
-0.02520835,
0.037080668,
-0.016012108,
0.014932806,
0.012153233,
0.06393015,
0.015627699,
-0.02547448,
0.015538989,
-0.0036149218,
-0.032615613,
0.023153242,
-0.034981206,
-0.025696253,
-0.05352154,
-0.008730517,
0.00115... | Text classification task guide
[OPTForSequenceClassification] is supported by this example script and notebook.
[OPTForQuestionAnswering] is supported by this question answering example script and notebook.
Question answering chapter
of the 🤗 Hugging Face Course.
⚡️ Inference
A blog post on How 🤗 Accelerate runs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.