vector listlengths 1.02k 1.02k | text stringlengths 2 11.8k |
|---|---|
[
0.033163633,
0.02203055,
-0.0021279508,
-0.0020248666,
-0.03269239,
-0.010433585,
-0.017215047,
0.03119031,
0.025240883,
0.0310725,
-0.017612658,
0.0017413853,
-0.00055131596,
-0.026301177,
-0.02588884,
0.011317164,
-0.03501915,
-0.029025542,
-0.026286451,
0.0013870336,
0.013... |
from transformers import TapasTokenizer, TFTapasForQuestionAnswering
import pandas as pd
model_name = "google/tapas-base-finetuned-wtq"
model = TFTapasForQuestionAnswering.from_pretrained(model_name)
tokenizer = TapasTokenizer.from_pretrained(model_name)
data = {"Actors": ["Brad Pitt", "Leonardo Di Caprio", "George C... |
[
0.038421955,
-0.02673783,
-0.02488529,
0.004700636,
0.0013912277,
-0.019590236,
-0.0033878128,
0.012858372,
-0.03109932,
0.030078234,
0.040785037,
0.0068339733,
0.017577242,
-0.035475396,
-0.04014321,
0.048778668,
-0.04463598,
0.002875447,
-0.044140026,
-0.014499401,
0.016381... | In case of a conversational set-up, then each table-question pair must be provided sequentially to the model, such that the prev_labels token types can be overwritten by the predicted labels of the previous table-question pair. Again, more info can be found in this notebook (for PyTorch) and this notebook (for TensorFl... |
[
0.015748007,
-0.0018984413,
-0.027148908,
0.003626006,
-0.00804488,
-0.025549501,
-0.034148023,
0.0004066868,
-0.014654395,
0.02933613,
0.000115448645,
0.031906117,
-0.012398821,
-0.044920094,
-0.016855288,
0.019261234,
-0.020095112,
-0.0027511166,
-0.03578844,
-0.028597943,
... | Text classification task guide
Masked language modeling task guide
TAPAS specific outputs
[[autodoc]] models.tapas.modeling_tapas.TableQuestionAnsweringOutput
TapasConfig
[[autodoc]] TapasConfig
TapasTokenizer
[[autodoc]] TapasTokenizer
- call
- convert_logits_to_predictions
- save_vocabulary |
[
0.0052463645,
-0.00729514,
-0.006340636,
0.006514492,
-0.0046634353,
0.02408078,
0.0037191578,
0.009054155,
0.006139508,
0.08126923,
0.005696345,
0.04216182,
-0.0014488011,
-0.023385355,
-0.025130734,
0.037907455,
-0.0006434382,
-0.052579552,
-0.021067273,
-0.019417346,
0.012... | TapasModel
[[autodoc]] TapasModel
- forward
TapasForMaskedLM
[[autodoc]] TapasForMaskedLM
- forward
TapasForSequenceClassification
[[autodoc]] TapasForSequenceClassification
- forward
TapasForQuestionAnswering
[[autodoc]] TapasForQuestionAnswering
- forward |
[
-0.0076160273,
-0.02888368,
-0.021117786,
0.01795693,
-0.011512599,
-0.01235731,
-0.020504689,
0.0002620564,
0.0044313287,
0.074988574,
0.009032963,
0.039973926,
0.021908,
-0.017970555,
-0.05013771,
0.054388516,
-0.013467697,
-0.045287434,
-0.022548346,
0.0038999782,
0.011860... | TFTapasModel
[[autodoc]] TFTapasModel
- call
TFTapasForMaskedLM
[[autodoc]] TFTapasForMaskedLM
- call
TFTapasForSequenceClassification
[[autodoc]] TFTapasForSequenceClassification
- call
TFTapasForQuestionAnswering
[[autodoc]] TFTapasForQuestionAnswering
- call |
[
0.02157659,
-0.017025623,
-0.025936093,
-0.010677835,
0.004550967,
-0.03349158,
-0.0019054412,
-0.018071314,
-0.01090612,
0.041297447,
-0.01184135,
-0.0075370786,
0.03493493,
-0.038351838,
0.005011218,
0.0017139766,
0.0018833491,
-0.02776237,
-0.060031522,
-0.005143771,
-0.02... |
LXMERT
Overview
The LXMERT model was proposed in LXMERT: Learning Cross-Modality Encoder Representations from Transformers by Hao Tan & Mohit Bansal. It is a series of bidirectional transformer encoders
(one for the vision modality, one for the language modality, and then one to fuse both modalities) pretrained using ... |
[
-0.0038921777,
0.00033864385,
-0.008129327,
-0.04289645,
-0.033267245,
-0.021598212,
-0.004323392,
0.01654363,
-0.03284728,
0.044366326,
-0.007769357,
0.017023591,
0.03536707,
-0.021193245,
0.002523541,
-0.02089327,
-0.011219071,
-0.017203575,
-0.06365473,
0.020098336,
-0.016... |
Bounding boxes are not necessary to be used in the visual feature embeddings, any kind of visual-spacial features
will work.
Both the language hidden states and the visual hidden states that LXMERT outputs are passed through the
cross-modality layer, so they contain information from both modalities. To access a m... |
[
0.054471683,
0.0128149465,
-0.05042417,
0.016777592,
-0.032693453,
0.018971082,
-0.005092032,
0.014649383,
-0.0063389265,
0.059380922,
-0.0004647295,
-0.0051899552,
0.002870796,
-0.03930004,
0.004096474,
-0.015772242,
-0.016281445,
0.0022718294,
-0.021386532,
-0.04010954,
0.0... | Resources
Question answering task guide |
[
0.0069392812,
-0.011194564,
-0.029699314,
0.0141078485,
-0.021566397,
-0.02967234,
0.020312065,
0.03479756,
-0.0070067183,
0.06619629,
-0.0037326454,
0.04661255,
0.029132843,
-0.032882348,
-0.03528311,
0.049390957,
0.020797612,
-0.034878485,
-0.035364036,
0.0011911084,
-0.030... | LxmertModel
[[autodoc]] LxmertModel
- forward
LxmertForPreTraining
[[autodoc]] LxmertForPreTraining
- forward
LxmertForQuestionAnswering
[[autodoc]] LxmertForQuestionAnswering
- forward
TFLxmertModel
[[autodoc]] TFLxmertModel
- call
TFLxmertForPreTraining
[[autodoc]] TFLxmertForPreTraining
- call |
[
-0.00014696429,
0.004849009,
-0.012582092,
0.036635518,
-0.025475975,
-0.051731426,
0.0018204084,
0.0092628095,
-0.008061113,
0.05383602,
-0.019707829,
0.028321072,
0.018265793,
-0.044586204,
-0.044586204,
0.021045934,
-0.0027541593,
-0.033777427,
-0.08137762,
0.01054895,
-0.... | LxmertConfig
[[autodoc]] LxmertConfig
LxmertTokenizer
[[autodoc]] LxmertTokenizer
LxmertTokenizerFast
[[autodoc]] LxmertTokenizerFast
Lxmert specific outputs
[[autodoc]] models.lxmert.modeling_lxmert.LxmertModelOutput
[[autodoc]] models.lxmert.modeling_lxmert.LxmertForPreTrainingOutput
[[autodoc]] models.lxmert.modelin... |
[
0.017895794,
-0.032893483,
-0.016809005,
-0.009665178,
0.0076220143,
-0.002706105,
0.0060316795,
-0.019344846,
0.0060932646,
0.05471621,
-0.0046840613,
-0.028720213,
0.038139053,
-0.008527672,
0.038805615,
0.030575,
-0.0059556044,
-0.006723602,
-0.054861113,
0.004557269,
0.01... |
DPT
Overview
The DPT model was proposed in Vision Transformers for Dense Prediction by René Ranftl, Alexey Bochkovskiy, Vladlen Koltun.
DPT is a model that leverages the Vision Transformer (ViT) as backbone for dense prediction tasks like semantic segmentation and depth estimation.
The abstract from the paper is the f... |
[
0.0091290455,
-0.023479,
0.009106412,
-0.013474774,
-0.026119635,
0.036425646,
-0.036908507,
0.0110076675,
0.021140154,
0.038960654,
-0.01875604,
-0.051605515,
0.04590175,
0.0013985925,
0.010373916,
0.06271126,
-0.03075206,
-0.015526922,
-0.09572672,
0.00553024,
0.0065638595,... |
DPT architecture. Taken from the original paper.
This model was contributed by nielsr. The original code can be found here.
Usage tips
DPT is compatible with the [AutoBackbone] class. This allows to use the DPT framework with various computer vision backbones available in the library, such as [VitDetBackbone] or [D... |
[
0.017458001,
-0.011414847,
-0.019518923,
-0.0011010973,
-0.028746534,
-0.016846374,
-0.026725503,
0.010457516,
0.022497289,
0.04337243,
-0.007605466,
0.0062359506,
0.051908635,
-0.0345703,
0.0027506659,
0.03507556,
0.024903912,
-0.026645724,
-0.043957468,
-0.02776261,
-0.0172... |
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 duplicating an existing resource.
DPTConfig
[[autodoc]] DPTConfig
DPTFeatureExtractor
[[autodoc]] DPTFeatureExtractor
- c... |
[
0.020834085,
-0.027459865,
-0.025003757,
0.0012307318,
-0.014950847,
-0.020634169,
0.0114309015,
0.022047859,
0.016093224,
0.047123015,
-0.020277176,
-0.0012307318,
0.051920995,
-0.029758899,
0.011802173,
0.040068842,
0.020719847,
-0.019777387,
-0.033700097,
-0.0145938555,
-0... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with DPT.
Demo notebooks for [DPTForDepthEstimation] can be found here.
Semantic segmentation task guide
Monocular depth estimation task guide |
[
0.04217103,
-0.004818486,
0.005564646,
-0.029296989,
-0.020090636,
0.025837183,
0.008211472,
-0.0054310053,
-0.0050783427,
0.06349413,
0.02999489,
0.016155664,
-0.016749622,
0.0059915534,
0.0037753468,
0.008649517,
-0.021501288,
-0.07353203,
-0.0695525,
0.008649517,
-0.009250... |
CANINE uses no less than 3 Transformer encoders internally: 2 "shallow" encoders (which only consist of a single
layer) and 1 "deep" encoder (which is a regular BERT encoder). First, a "shallow" encoder is used to contextualize
the character embeddings, using local attention. Next, after downsampling, a "deep" en... |
[
0.069971345,
-0.0018509016,
0.0125062885,
0.0000034768202,
-0.05069293,
0.017492836,
0.019989738,
-0.0039195567,
-0.0011323163,
0.045524925,
0.048950907,
0.021949517,
-0.036843833,
-0.034143694,
-0.01077878,
0.03754064,
-0.032314565,
-0.021528527,
-0.043782897,
-0.024852892,
... | Model checkpoints:
google/canine-c: Pre-trained with autoregressive character loss,
12-layer, 768-hidden, 12-heads, 121M parameters (size ~500 MB).
google/canine-s: Pre-trained with subword loss, 12-layer,
768-hidden, 12-heads, 121M parameters (size ~500 MB).
Usage example
CANINE works on raw characters, so i... |
[
0.038939457,
-0.015971377,
-0.009897235,
-0.040592685,
-0.017388431,
-0.008908249,
0.030260002,
-0.024739398,
-0.02401611,
0.0649483,
0.033153154,
0.009594635,
-0.028621534,
-0.021388656,
-0.022126704,
-0.0073103737,
-0.012768245,
-0.04245257,
-0.08183486,
0.019720666,
0.0156... |
CANINE
Overview
The CANINE model was proposed in CANINE: Pre-training an Efficient Tokenization-Free Encoder for Language
Representation by Jonathan H. Clark, Dan Garrette, Iulia Turc, John Wieting. It's
among the first papers that trains a Transformer without using an explicit tokenization step (such as Byte Pair
Enc... |
[
0.040417846,
-0.013018106,
-0.0011823225,
-0.016304927,
-0.014582575,
0.006803288,
0.010779049,
-0.0010459697,
0.007973052,
0.054799482,
0.004510408,
0.008367757,
-0.0024059096,
-0.025404684,
0.0065557,
0.030887503,
-0.020051042,
-0.033212677,
-0.04934537,
0.009027992,
0.0105... | from transformers import CanineModel
import torch
model = CanineModel.from_pretrained("google/canine-c") # model pre-trained with autoregressive character loss
text = "hello world"
use Python's built-in ord() function to turn each character into its unicode code point id
input_ids = torch.tensor([[ord(char) for char i... |
[
0.028144155,
0.03697093,
0.015327002,
0.010878364,
-0.05826235,
-0.007564799,
-0.02388587,
-0.0063803755,
0.00007755153,
0.047489736,
-0.0006036681,
-0.015665408,
-0.03398167,
-0.031330816,
-0.05933397,
0.028623562,
-0.02750964,
-0.08014598,
-0.039593577,
0.0008821486,
-0.020... | For batched inference and training, it is however recommended to make use of the tokenizer (to pad/truncate all
sequences to the same length):
thon |
[
0.029339885,
-0.0065374076,
-0.027326362,
0.011924231,
-0.022384083,
0.0025250737,
0.0057594557,
-0.013976977,
0.00087437825,
0.05172397,
-0.010165669,
-0.0034452137,
0.023691565,
-0.038335357,
0.00025209878,
-0.016147396,
-0.035589647,
-0.01808247,
-0.049501248,
-0.034099117,
... | Resources
Text classification task guide
Token classification task guide
Question answering task guide
Multiple choice task guide |
[
0.025606617,
0.007096059,
0.024127983,
-0.010965381,
-0.03487917,
-0.032308836,
0.008270674,
0.011683969,
0.007890652,
0.038859043,
0.024777476,
0.0325023,
0.017964708,
-0.045657992,
-0.011469774,
0.0166519,
-0.012305824,
-0.06881864,
-0.04739919,
0.0247222,
-0.0060216314,
... | from transformers import CanineTokenizer, CanineModel
model = CanineModel.from_pretrained("google/canine-c")
tokenizer = CanineTokenizer.from_pretrained("google/canine-c")
inputs = ["Life is like a box of chocolates.", "You never know what you gonna get."]
encoding = tokenizer(inputs, padding="longest", truncation=True... |
[
0.012449311,
-0.0064811665,
0.0046582315,
-0.012230422,
-0.021095427,
0.004189672,
-0.010308304,
0.032258764,
-0.005407242,
0.045556273,
0.0005942494,
0.04268335,
-0.012948652,
-0.0046719117,
-0.027908346,
0.030234043,
-0.022572927,
-0.06254753,
-0.06933309,
-0.005044707,
-0.... |
CanineConfig
[[autodoc]] CanineConfig
CanineTokenizer
[[autodoc]] CanineTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
CANINE specific outputs
[[autodoc]] models.canine.modeling_canine.CanineModelOutputWithPooling
CanineModel
[[autodoc]] Canin... |
[
0.026265187,
-0.022698851,
0.0016022933,
0.010669775,
-0.01737858,
-0.04832093,
-0.008667366,
0.014265344,
-0.040252823,
0.03630647,
-0.023181183,
-0.027434478,
0.02123724,
-0.0268206,
-0.024335857,
0.042445246,
-0.0014305538,
-0.027682953,
-0.03554643,
0.02980229,
0.00519603... | The architecture is similar than llava architecture except that the multi-modal projector takes a set of concatenated vision hidden states and has an additional layernorm layer on that module.
We advise users to use padding_side="left" when computing batched generation as it leads to more accurate results. Simply make... |
[
0.023771105,
-0.007498142,
-0.034044802,
0.026151229,
-0.0049560796,
-0.020170793,
0.031724934,
0.0104394015,
-0.024207963,
0.059021033,
-0.003991979,
-0.0015949085,
-0.0074529494,
-0.022370147,
-0.00016805856,
0.017459258,
0.0020713098,
-0.03410506,
-0.034918517,
-0.009136359,... |
VipLlava
Overview
The VipLlava model was proposed in Making Large Multimodal Models Understand Arbitrary Visual Prompts by Mu Cai, Haotian Liu, Siva Karthik Mustikovela, Gregory P. Meyer, Yuning Chai, Dennis Park, Yong Jae Lee.
VipLlava enhances the training protocol of Llava by marking images and interact with the mo... |
[
0.03513639,
0.004099727,
-0.030892309,
0.013692222,
-0.010574119,
-0.027037987,
-0.023429073,
0.042873904,
-0.024915947,
0.03860095,
0.016341165,
0.009960604,
-0.008430424,
-0.039207246,
-0.045039255,
-0.008574781,
0.0008350126,
-0.008228325,
-0.027211215,
-0.046425078,
0.010... | A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.###Human: <image>\n<prompt1>###Assistant: <answer1>###Human: <prompt2>###Assistant:
The original code can be found here.
This model was contributed by Younes Belkad... |
[
-0.003865014,
-0.0037053027,
-0.017192036,
0.014466297,
-0.019151162,
-0.039949127,
0.0038259735,
-0.014977373,
0.00055632775,
0.017688917,
0.0032918279,
0.033049595,
0.018313564,
-0.0020797963,
-0.0503694,
0.01767472,
-0.034668006,
-0.016979089,
-0.043469872,
0.015502646,
0.... |
NLLB
Updated tokenizer behavior
DISCLAIMER: The default behaviour for the tokenizer was fixed and thus changed in April 2023.
The previous version adds [self.eos_token_id, self.cur_lang_code] at the end of the token sequence for both target and source tokenization. This is wrong as the NLLB paper mentions (page 48, 6.... |
[
0.05569324,
-0.006403592,
-0.013887989,
-0.008173145,
-0.021107484,
-0.051793862,
-0.025247036,
0.036902774,
-0.005121461,
0.072449245,
0.020867305,
-0.022124711,
-0.019482743,
-0.029527871,
-0.030347304,
0.004273771,
0.004644635,
-0.03823082,
-0.022845248,
-0.045294907,
0.03... | 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:
A chat between a curious human and an artificial intel... |
[
0.035344396,
0.006291839,
-0.03653007,
-0.014693896,
-0.011320369,
-0.042119678,
0.047229372,
0.008179744,
0.009612434,
0.05262137,
-0.0123296045,
0.018095654,
0.031787373,
-0.041950297,
-0.039268415,
-0.006002478,
-0.039381336,
-0.045930777,
-0.01997297,
0.0029818306,
-0.001... | from transformers import NllbTokenizer
tokenizer = NllbTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
tokenizer("How was your day?").input_ids
[13374, 1398, 4260, 4039, 248130, 2, 256047]
2: ''
256047 : 'eng_Latn'
New behaviour
thon
from transformers import NllbTokenizer
tokenizer = NllbTokenizer.from... |
[
0.025060242,
-0.011869893,
-0.049751326,
0.0024669785,
0.011962184,
-0.019920407,
0.018330183,
-0.021610022,
-0.0148657635,
0.054493602,
0.01081211,
0.00037093417,
-0.00033676918,
-0.051540326,
-0.013509813,
0.0023036965,
-0.00025557188,
-0.02581276,
-0.03842097,
-0.0078091407,... |
For more details, feel free to check the linked PR and Issue.
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 ... |
[
0.008487725,
-0.00024654123,
-0.017484438,
0.03615193,
-0.014664367,
-0.011287161,
0.019699225,
0.0068954164,
0.008707828,
0.04778988,
-0.009773952,
0.014898227,
0.019300288,
-0.011851175,
-0.016535243,
0.03769265,
-0.040774096,
-0.052962303,
-0.02447271,
0.020896036,
0.00922... | Enabling the old behaviour can be done as follows:
thon
from transformers import NllbTokenizer
tokenizer = NllbTokenizer.from_pretrained("facebook/nllb-200-distilled-600M", legacy_behaviour=True) |
[
-0.020252764,
-0.006451602,
-0.018204408,
0.00626047,
-0.0026992867,
-0.01883911,
0.01689173,
-0.004139988,
-0.024984179,
0.04116908,
0.0017769854,
0.0039777067,
0.0046448647,
-0.039005324,
-0.01400672,
-0.032629453,
-0.035543315,
-0.03462011,
-0.058075234,
0.035024013,
-0.00... | 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.028072031,
0.008109233,
-0.008325386,
0.022689117,
-0.010005804,
-0.024599634,
0.0042254473,
0.0210854,
0.0115397945,
0.04258916,
-0.00023619972,
0.0052957544,
0.024292836,
-0.04889247,
-0.040859934,
0.02367924,
-0.022912243,
-0.04919927,
-0.012760014,
-0.034751862,
-0.0024... |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
article = "UN Chief says there is no military solution in Syria"
inputs = tokenizer(article, ret... |
[
0.014498531,
0.014154664,
-0.009937038,
0.03160764,
-0.009642296,
-0.00935457,
0.008814208,
-0.0018158252,
0.011810759,
0.04847815,
-0.0013395001,
-0.00054913363,
0.02240044,
-0.043649983,
-0.016351199,
0.03820426,
-0.030316386,
-0.06742589,
-0.027509313,
-0.014063435,
0.0052... |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(
"facebook/nllb-200-distilled-600M", token=True, src_lang="ron_Latn"
)
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M", token=True)
article = "Şeful ONU spune că nu există o s... |
[
0.015604513,
-0.014539036,
-0.032314964,
0.026596455,
-0.020985844,
-0.005755597,
0.008867733,
0.017519673,
0.0069019957,
0.052221842,
-0.007195339,
0.0018342383,
-0.0021022933,
-0.06484572,
-0.0064434363,
0.01324428,
-0.01885489,
-0.048634287,
-0.05168236,
0.023211207,
-0.01... | Resources
Translation task guide
Summarization task guide
NllbTokenizer
[[autodoc]] NllbTokenizer
- build_inputs_with_special_tokens
NllbTokenizerFast
[[autodoc]] NllbTokenizerFast |
[
0.020849405,
-0.015705494,
-0.015676677,
-0.032016154,
-0.015921626,
-0.0017974867,
-0.0105327675,
-0.024451582,
-0.034609724,
0.06622244,
0.00036697186,
-0.024667712,
0.054493744,
-0.020273056,
0.02626708,
-0.015157964,
-0.0058895606,
-0.015157964,
-0.083570525,
-0.007236775,
... |
DeiT
Overview
The DeiT model was proposed in Training data-efficient image transformers & distillation through attention by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre
Sablayrolles, Hervé Jégou. The Vision Transformer (ViT) introduced in Dosovitskiy et al., 2020 has shown that one can match... |
[
0.01283544,
-0.015659535,
-0.011161902,
-0.051461298,
-0.035174187,
-0.01627217,
-0.035562687,
-0.015166439,
-0.047905028,
0.0749506,
0.009047566,
-0.0014494036,
0.057557758,
-0.024520323,
0.0061114025,
-0.013194055,
-0.014105536,
-0.005905946,
-0.102265134,
-0.0096602,
-0.00... |
Compared to ViT, DeiT models use a so-called distillation token to effectively learn from a teacher (which, in the
DeiT paper, is a ResNet like-model). The distillation token is learned through backpropagation, by interacting with
the class ([CLS]) and patch tokens through the self-attention layers.
There are 2 w... |
[
0.03520608,
-0.02312798,
0.0055626426,
-0.019686889,
-0.04299309,
-0.03402706,
-0.040580217,
0.018466739,
-0.0025705374,
0.070741184,
0.027940027,
-0.0088357935,
0.044473723,
-0.031806115,
-0.015149033,
0.041814074,
0.02485538,
-0.0398399,
-0.05544135,
-0.018425612,
0.0205917... | Besides that:
[DeiTForMaskedImageModeling] is supported by this example script.
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 duplicating an existing resource.
DeiTConfig
... |
[
0.011416229,
-0.04272323,
0.0052201245,
-0.0045121945,
-0.018571133,
0.003311119,
-0.0012079484,
0.02294243,
-0.024963122,
0.05641446,
-0.014199838,
0.0022509424,
0.048139237,
-0.010275294,
-0.004013894,
0.02925194,
0.0014012546,
-0.029499372,
-0.044840146,
-0.0115880575,
0.0... | DeiTModel
[[autodoc]] DeiTModel
- forward
DeiTForMaskedImageModeling
[[autodoc]] DeiTForMaskedImageModeling
- forward
DeiTForImageClassification
[[autodoc]] DeiTForImageClassification
- forward
DeiTForImageClassificationWithTeacher
[[autodoc]] DeiTForImageClassificationWithTeacher
- forward |
[
0.032722127,
-0.009966422,
0.005321666,
-0.020624157,
-0.032347664,
-0.024642412,
0.0276525,
-0.0014762403,
-0.015223278,
0.04839188,
-0.008288549,
0.005069625,
0.046173915,
-0.03252049,
-0.023331799,
0.012544442,
0.0067438977,
-0.040845048,
-0.052597363,
-0.0067727026,
-0.00... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with DeiT.
[DeiTForImageClassification] is supported by this example script and notebook.
See also: Image classification task guide
Besides that:
[DeiTForMaskedImageModeling] is supported by this example scrip... |
[
0.060596935,
0.0169471,
0.002472066,
0.018509181,
-0.0008008426,
-0.005183602,
0.01108193,
-0.045919273,
0.01808182,
0.06666842,
0.023740677,
0.0063035847,
-0.026805893,
-0.06100956,
0.019629164,
-0.03133003,
-0.0058614863,
-0.06201165,
-0.06407478,
-0.007906191,
-0.000819263... |
PEGASUS-X
Overview
The PEGASUS-X model was proposed in Investigating Efficiently Extending Transformers for Long Input Summarization by Jason Phang, Yao Zhao and Peter J. Liu.
PEGASUS-X (PEGASUS eXtended) extends the PEGASUS models for long input summarization through additional long input pretraining and using stagg... |
[
0.00073781254,
-0.033152767,
0.002457429,
0.013079594,
0.027093446,
-0.03325954,
0.019566005,
0.024691071,
-0.011137675,
0.07474054,
0.0108707445,
0.026306,
0.043189354,
-0.02434406,
-0.01855167,
0.038971853,
0.007307222,
-0.033312924,
-0.061394013,
-0.015962444,
0.013786959,... | TFDeiTModel
[[autodoc]] TFDeiTModel
- call
TFDeiTForMaskedImageModeling
[[autodoc]] TFDeiTForMaskedImageModeling
- call
TFDeiTForImageClassification
[[autodoc]] TFDeiTForImageClassification
- call
TFDeiTForImageClassificationWithTeacher
[[autodoc]] TFDeiTForImageClassificationWithTeacher
- call |
[
0.020140726,
0.025946317,
-0.0102560865,
-0.029578252,
0.062128086,
-0.0011831301,
-0.04080423,
-0.012794313,
-0.035218753,
0.06036715,
-0.005612989,
-0.037227325,
0.038933232,
-0.05552457,
0.015490749,
-0.024419254,
-0.01692151,
-0.024488041,
-0.022451956,
-0.02922056,
-0.00... |
Wav2Vec2-BERT follows the same architecture as Wav2Vec2-Conformer, but employs a causal depthwise convolutional layer and uses as input a mel-spectrogram representation of the audio instead of the raw waveform.
Wav2Vec2-BERT can use either no relative position embeddings, Shaw-like position embeddings, Transformer-XL... |
[
0.021349762,
0.03445245,
-0.028804997,
0.023292007,
0.01105586,
-0.045956522,
-0.020737208,
-0.03564768,
0.005232858,
0.039681572,
-0.0069173826,
-0.015343741,
0.01786866,
-0.08312812,
0.009300369,
-0.009629057,
-0.021484226,
-0.042639762,
-0.029522134,
-0.013334263,
0.001100... |
Wav2Vec2-BERT
Overview
The Wav2Vec2-BERT model was proposed in Seamless: Multilingual Expressive and Streaming Speech Translation by the Seamless Communication team from Meta AI.
This model was pre-trained on 4.5M hours of unlabeled audio data covering more than 143 languages. It requires finetuning to be used for dow... |
[
0.012706923,
0.027333809,
0.0053788247,
0.0022845347,
0.0043931953,
-0.026161313,
-0.02324473,
-0.032126386,
-0.017250344,
0.06554252,
0.041506354,
-0.007328099,
0.019741898,
-0.05126738,
-0.033826504,
0.008954937,
-0.02852096,
-0.054726243,
-0.05724711,
-0.05200019,
-0.01090... | Resources
[Wav2Vec2BertForCTC] is supported by this example script.
You can also adapt these notebooks on how to finetune a speech recognition model in English, and how to finetune a speech recognition model in any language.
[Wav2Vec2BertForSequenceClassification] can be used by adapting this example script.
See also... |
[
-0.0033356028,
0.014156801,
0.007234492,
-0.0056939386,
0.008225332,
-0.0040515866,
-0.027037725,
0.0019935572,
-0.015948458,
0.06352237,
0.014034643,
-0.020278294,
0.045660093,
-0.04606729,
-0.012833418,
0.019803233,
-0.036511786,
-0.05339679,
-0.061839294,
-0.046990264,
0.0... |
Wav2Vec2BertConfig
[[autodoc]] Wav2Vec2BertConfig
Wav2Vec2BertProcessor
[[autodoc]] Wav2Vec2BertProcessor
- call
- pad
- from_pretrained
- save_pretrained
- batch_decode
- decode
Wav2Vec2BertModel
[[autodoc]] Wav2Vec2BertModel
- forward
Wav2Vec2BertForCTC
[[autodoc]] Wav2Vec2BertForCTC
... |
[
0.026699143,
-0.018105665,
0.005671271,
0.011879634,
0.0056324024,
0.031716716,
0.0044416124,
-0.0070882053,
0.017964326,
0.068352066,
-0.00089441775,
0.020946601,
-0.01932119,
-0.020861797,
0.025186803,
-0.0014195845,
-0.0074132876,
-0.034967538,
-0.07197037,
-0.0023815804,
... | Translation task guide
Summarization task guide
PEGASUS-X uses the same tokenizer as PEGASUS.
PegasusXConfig
[[autodoc]] PegasusXConfig
PegasusXModel
[[autodoc]] PegasusXModel
- forward
PegasusXForConditionalGeneration
[[autodoc]] PegasusXForConditionalGeneration
- forward |
[
0.020806994,
-0.006721601,
-0.020831458,
-0.015779555,
-0.012489089,
0.0072903987,
-0.01102734,
-0.02957749,
-0.019755023,
0.03564467,
-0.0059020426,
0.013149628,
0.019669399,
-0.034030017,
-0.020880386,
-0.010599212,
-0.05323459,
-0.03427466,
-0.056708537,
-0.038849507,
-0.0... | Text classification task guide
Token classification task guide
Question answering task guide
Causal language modeling task guide
Masked language modeling task guide
Multiple choice task guide |
[
0.038789418,
-0.03567922,
-0.033772025,
-0.023238441,
0.025688453,
-0.009242562,
0.02963488,
-0.014641391,
0.009697354,
0.055191297,
0.046154123,
-0.0107609825,
0.00007249405,
-0.01640188,
0.01112775,
-0.02401599,
-0.0016367036,
-0.01440666,
-0.03462293,
-0.0044378964,
0.0044... |
RoFormer
Overview
The RoFormer model was proposed in RoFormer: Enhanced Transformer with Rotary Position Embedding by Jianlin Su and Yu Lu and Shengfeng Pan and Bo Wen and Yunfeng Liu.
The abstract from the paper is the following:
Position encoding in transformer architecture provides supervision for dependency modeli... |
[
0.003379352,
-0.0061334493,
-0.01761299,
-0.0049656457,
-0.008521988,
-0.004423097,
0.023170808,
0.002529138,
-0.010500306,
0.084108315,
0.04411849,
0.016316166,
0.035199516,
-0.03490839,
-0.012068406,
0.022919383,
-0.013351996,
-0.067964174,
-0.045918167,
-0.033135183,
0.016... |
RoFormerModel
[[autodoc]] RoFormerModel
- forward
RoFormerForCausalLM
[[autodoc]] RoFormerForCausalLM
- forward
RoFormerForMaskedLM
[[autodoc]] RoFormerForMaskedLM
- forward
RoFormerForSequenceClassification
[[autodoc]] RoFormerForSequenceClassification
- forward
RoFormerForMultipleChoice
[[autodoc]] ... |
[
-0.0011240422,
-0.024230687,
-0.016053343,
0.00877318,
-0.007999277,
-0.0015674953,
-0.004455077,
0.00798558,
-0.00745823,
0.06289843,
0.045776684,
0.03435306,
0.044461735,
-0.023600606,
-0.035531037,
0.038571857,
-0.0066055674,
-0.042955022,
-0.034709193,
-0.022888342,
0.024... |
TFRoFormerModel
[[autodoc]] TFRoFormerModel
- call
TFRoFormerForMaskedLM
[[autodoc]] TFRoFormerForMaskedLM
- call
TFRoFormerForCausalLM
[[autodoc]] TFRoFormerForCausalLM
- call
TFRoFormerForSequenceClassification
[[autodoc]] TFRoFormerForSequenceClassification
- call
TFRoFormerForMultipleChoice
[[auto... |
[
-0.00040348351,
-0.039567858,
-0.012091697,
0.010875695,
0.0033952391,
-0.010944011,
-0.0055676457,
0.040087048,
0.012979788,
0.069954224,
0.03525037,
0.042874288,
0.039704487,
-0.0046829707,
-0.038064934,
0.05331277,
-0.0017010353,
-0.07481823,
-0.026547082,
-0.00586823,
0.0... | FlaxRoFormerModel
[[autodoc]] FlaxRoFormerModel
- call
FlaxRoFormerForMaskedLM
[[autodoc]] FlaxRoFormerForMaskedLM
- call
FlaxRoFormerForSequenceClassification
[[autodoc]] FlaxRoFormerForSequenceClassification
- call
FlaxRoFormerForMultipleChoice
[[autodoc]] FlaxRoFormerForMultipleChoice
- call
FlaxRoFo... |
[
-0.0033429826,
0.0076302714,
-0.027391778,
0.009780808,
-0.023752408,
-0.00956024,
0.011441961,
0.01309622,
0.017342152,
0.052853588,
0.029114965,
0.00862972,
0.013392609,
-0.056327533,
-0.007285634,
0.022442786,
-0.017355938,
-0.03950923,
-0.054342423,
-0.0054383776,
-0.0128... | RoFormerConfig
[[autodoc]] RoFormerConfig
RoFormerTokenizer
[[autodoc]] RoFormerTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
- save_vocabulary
RoFormerTokenizerFast
[[autodoc]] RoFormerTokenizerFast
- build_inputs_with_special_tokens |
[
-0.0044704606,
-0.015932707,
-0.018324828,
-0.0110377185,
-0.030359263,
0.016715314,
-0.030418327,
-0.0073424825,
-0.028734984,
0.047340367,
-0.04270379,
-0.046040945,
0.03762422,
-0.013289561,
0.00023925824,
0.018841643,
-0.0002319905,
-0.025766982,
-0.047045045,
0.0261952,
... |
OWL-ViT architecture. Taken from the original paper.
This model was contributed by adirik. The original code can be found here.
Usage tips
OWL-ViT is a zero-shot text-conditioned object detection model. OWL-ViT uses CLIP as its multi-modal backbone, with a ViT-like Transformer to get visual features and a causal la... |
[
0.018949833,
0.0023152588,
-0.0074002733,
-0.026649538,
-0.017253045,
-0.004894304,
-0.033650566,
0.0028446137,
0.00809182,
0.056321923,
0.020589584,
-0.018921316,
0.016269194,
-0.02185861,
-0.024582025,
0.006883395,
-0.0032937631,
-0.03151176,
-0.030142924,
-0.010843753,
-0.... |
import requests
from PIL import Image
import torch
from transformers import OwlViTProcessor, OwlViTForObjectDetection
processor = OwlViTProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")
url = "http://images.cocodataset.org/val2017/00... |
[
0.0014540801,
-0.0058642365,
-0.031934474,
-0.023545409,
-0.052752327,
0.013313402,
-0.032376777,
0.010490017,
-0.026582574,
0.051572848,
-0.030312685,
-0.029722944,
0.041163918,
-0.013328145,
0.0067672776,
0.02841077,
0.009384253,
-0.014124296,
-0.056467697,
0.009841302,
-0.... |
Resources
A demo notebook on using OWL-ViT for zero- and one-shot (image-guided) object detection can be found here.
OwlViTConfig
[[autodoc]] OwlViTConfig
- from_text_vision_configs
OwlViTTextConfig
[[autodoc]] OwlViTTextConfig
OwlViTVisionConfig
[[autodoc]] OwlViTVisionConfig
OwlViTImageProcessor
[[autodoc]] Owl... |
[
-0.0074474034,
-0.009762486,
-0.025536064,
-0.008551407,
-0.015271423,
0.010124333,
-0.008514483,
-0.013248034,
-0.021843748,
0.050569974,
-0.010441872,
-0.031576697,
0.033998854,
-0.0240296,
0.0023575444,
0.00335447,
-0.0072258646,
-0.012657262,
-0.04401242,
0.006158785,
-0.... |
OWL-ViT
Overview
The OWL-ViT (short for Vision Transformer for Open-World Localization) was proposed in Simple Open-Vocabulary Object Detection with Vision Transformers by Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh Mahendran, Anurag Arnab, Mostafa D... |
[
0.014335808,
-0.0051225172,
-0.015291529,
0.029612856,
-0.022213263,
-0.003862704,
-0.043297037,
-0.0038047815,
-0.018882722,
0.0655103,
0.034492824,
0.015682505,
0.0049306494,
-0.049639545,
-0.014183762,
0.029511493,
-0.012076832,
-0.054881528,
-0.06452562,
-0.003372173,
0.0... |
import torch
from transformers import AutoTokenizer, RwkvConfig, RwkvModel
model = RwkvModel.from_pretrained("sgugger/rwkv-430M-pile")
tokenizer = AutoTokenizer.from_pretrained("sgugger/rwkv-430M-pile")
inputs = tokenizer("This is an example.", return_tensors="pt")
Feed everything to the model
outputs = model(inputs[... |
[
0.03574853,
0.026730618,
-0.031195512,
0.040477794,
-0.02811121,
0.007266469,
-0.012036121,
-0.002394006,
-0.032811098,
0.10445503,
0.03563103,
-0.0022214318,
0.0031063328,
-0.017830202,
-0.018182695,
0.017169282,
-0.0057793944,
-0.053754978,
-0.020400455,
0.0027244668,
0.013... |
RWKV
Overview
The RWKV model was proposed in this repo
It suggests a tweak in the traditional Transformer attention to make it linear. This way, the model can be used as recurrent network: passing inputs for timestamp 0 and timestamp 1 together is the same as passing inputs at timestamp 0, then inputs at timestamp 1 a... |
[
0.0064903656,
0.006681467,
0.023229422,
0.019279996,
-0.0004109562,
-0.031906836,
0.010595504,
-0.013419556,
0.0010829072,
0.082669,
0.014849277,
0.0034362841,
0.04764792,
-0.019520642,
-0.028764281,
0.016222375,
0.00056578364,
-0.047591295,
-0.044363808,
-0.0014208733,
-0.01... |
If you want to make sure the model stops generating when '\n\n' is detected, we recommend using the following stopping criteria:
thon
from transformers import StoppingCriteria
class RwkvStoppingCriteria(StoppingCriteria):
def init(self, eos_sequence = [187,187], eos_token_id = 537):
self.eos_sequence = e... |
[
-0.006705131,
0.0018915774,
0.014904759,
0.041819107,
-0.036430877,
-0.07581054,
-0.005016282,
0.019113477,
-0.004356157,
0.043883257,
0.006182392,
0.0029906693,
-0.011011025,
-0.031712823,
-0.014113949,
-0.025051253,
-0.0042187707,
-0.04535765,
-0.046563968,
0.013792263,
-0.... | output = model.generate(inputs["input_ids"], max_new_tokens=64, stopping_criteria = [RwkvStoppingCriteria()]) |
[
-0.007251733,
0.015085115,
0.0044303555,
0.01229773,
-0.02160412,
0.009782285,
-0.010469689,
-0.015802734,
-0.06532603,
0.055354893,
0.02500337,
0.028780315,
-0.0067418455,
-0.0026495263,
-0.0129926875,
0.036319096,
-0.007164863,
-0.07124827,
-0.03329754,
-0.0032425066,
0.031... |
RwkvConfig
[[autodoc]] RwkvConfig
RwkvModel
[[autodoc]] RwkvModel
- forward
RwkvLMHeadModel
[[autodoc]] RwkvForCausalLM
- forward
Rwkv attention and the recurrent formulas
In a traditional auto-regressive Transformer, attention is written as
$$O = \hbox{softmax}(QK^{T} / \sqrt{d}) V$$
with \(Q\), \(K\) and \(... |
[
0.0057211774,
-0.0071559,
-0.016224762,
0.01300815,
-0.055801846,
-0.01715999,
0.0031865009,
-0.012901874,
-0.029785547,
0.049538665,
0.016295614,
0.013603294,
-0.020971745,
-0.041376688,
-0.037607443,
-0.03182604,
-0.029813888,
-0.014184268,
-0.070793815,
0.00679102,
0.02425... | ByT5's architecture is based on the T5v1.1 model, refer to T5v1.1's documentation page for the API reference. They
only differ in how inputs should be prepared for the model, see the code examples below.
Since ByT5 was pre-trained unsupervisedly, there's no real advantage to using a task prefix during single-task
fine... |
[
0.036062505,
0.00618031,
-0.014686259,
0.01839369,
-0.01976793,
-0.015705613,
0.03621352,
0.0067390674,
-0.008139737,
0.043945517,
0.032377727,
0.0030297488,
0.030157799,
-0.038146522,
-0.012700405,
-0.011212902,
-0.007260071,
-0.031864274,
-0.043250844,
-0.0016724969,
0.0033... |
from transformers import T5ForConditionalGeneration
import torch
model = T5ForConditionalGeneration.from_pretrained("google/byt5-small")
num_special_tokens = 3
Model has 3 special tokens which take up the input ids 0,1,2 of ByT5.
=> Need to shift utf-8 character encodings by 3 before passing ids to model.
input_ids =... |
[
0.037462745,
-0.0152765075,
0.0033196737,
0.023222694,
-0.015682079,
-0.033016484,
0.009005179,
-0.046745814,
-0.022847166,
0.057020277,
0.0080813775,
-0.00399187,
-0.01111565,
-0.039205197,
-0.011258351,
-0.010109233,
-0.016523262,
-0.010920375,
-0.03962579,
0.013639202,
0.0... |
ByT5
Overview
The ByT5 model was presented in ByT5: Towards a token-free future with pre-trained byte-to-byte models by Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir
Kale, Adam Roberts, Colin Raffel.
The abstract from the paper is the following:
Most widely-used pre-trained language mode... |
[
0.03545003,
0.0231768,
-0.035745446,
0.0021182736,
-0.055592094,
0.0083321,
0.005565923,
0.0031220196,
0.015885374,
0.025553564,
-0.011568258,
-0.012514935,
-0.020692613,
-0.037759654,
-0.03571859,
0.024788165,
-0.039747003,
-0.060157627,
-0.035611168,
-0.011749537,
-0.027903... | For batched inference and training it is however recommended to make use of the tokenizer:
thon |
[
0.030674303,
-0.013267972,
-0.0003168201,
0.021270286,
-0.020306151,
-0.023050226,
-0.015248155,
-0.011688274,
-0.0075944117,
0.0457148,
0.032691568,
0.028019225,
-0.0009001677,
-0.02113679,
-0.021848766,
-0.03295856,
-0.024919163,
-0.018081225,
-0.054080516,
0.008172892,
0.0... | Similar to T5, ByT5 was trained on the span-mask denoising task. However,
since the model works directly on characters, the pretraining task is a bit
different. Let's corrupt some characters of the
input sentence "The dog chases a ball in the park." and ask ByT5 to predict them
for us.
thon |
[
0.028275026,
0.012174582,
-0.005135233,
0.02617241,
-0.03940565,
-0.027775103,
0.029995348,
0.013394981,
0.006826147,
0.026745852,
0.014931507,
-0.0063482802,
0.019496975,
-0.035465088,
-0.00988082,
-0.0057160254,
-0.012483357,
-0.03764122,
-0.05087446,
0.015659336,
-0.007421... |
from transformers import T5ForConditionalGeneration, AutoTokenizer
model = T5ForConditionalGeneration.from_pretrained("google/byt5-small")
tokenizer = AutoTokenizer.from_pretrained("google/byt5-small")
model_inputs = tokenizer(
["Life is like a box of chocolates.", "Today is Monday."], padding="longest", return_... |
[
-0.000152483,
-0.048048206,
0.0023094683,
0.028122002,
-0.0017444231,
-0.030811688,
-0.010857318,
0.024897195,
0.004330253,
0.050414003,
0.0043795407,
0.004946346,
-0.004052131,
-0.012230325,
0.00023213502,
0.00782262,
-0.005643411,
-0.03912014,
-0.06421448,
0.02048949,
0.006... | ByT5Tokenizer
[[autodoc]] ByT5Tokenizer
See [ByT5Tokenizer] for all details. |
[
0.030017095,
0.002239737,
-0.009282209,
0.035651073,
-0.024029069,
-0.01939566,
0.0047757966,
-0.01788711,
0.0036328381,
0.04328619,
0.017179014,
0.035589498,
-0.021720061,
-0.040884823,
-0.038606603,
-0.004760403,
-0.013730897,
-0.041716065,
-0.031371713,
-0.0059687835,
0.01... |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
tokenizer = AutoTokenizer.from_pretrained("google/byt5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("google/byt5-base")
input_ids_prompt = "The dog chases a ball in the park."
input_ids = tokenizer(input_ids_prompt).input_ids
Note that... |
[
0.04145663,
-0.017457658,
-0.036925852,
0.0044883033,
-0.013394116,
0.00084288424,
0.011022536,
0.0011043774,
-0.026986454,
0.037860323,
0.06496005,
0.0006738649,
-0.006297075,
-0.040210664,
0.009557112,
0.0025361744,
-0.042164564,
-0.0495554,
-0.01992127,
-0.0036228537,
0.05... | FLAN-T5
Overview
FLAN-T5 was released in the paper Scaling Instruction-Finetuned Language Models - it is an enhanced version of T5 that has been finetuned in a mixture of tasks.
One can directly use FLAN-T5 weights without finetuning the model:
thon |
[
0.020765394,
0.017082108,
-0.006935697,
0.012106197,
-0.023461837,
-0.01359341,
-0.013468318,
0.01998704,
0.022155313,
0.061323237,
0.016484443,
0.004788272,
0.0022099717,
-0.06610456,
-0.025101943,
0.04066904,
-0.014330068,
-0.08100449,
-0.044672005,
-0.014969431,
0.01972295... | from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")
inputs = tokenizer("A step by step recipe to make bolognese pasta:", return_tensors="pt")
outputs = model.generate(**input... |
[
-0.0011318624,
-0.04577171,
0.008053468,
0.025280885,
0.0034104686,
-0.03546327,
-0.009257986,
0.030589173,
0.0065828348,
0.027437815,
0.04305454,
0.023796247,
-0.009832234,
-0.022059498,
-0.006442774,
-0.007822368,
0.010609568,
-0.010455502,
-0.038096406,
0.010623574,
0.0298... | CTRL |
[
0.041994683,
-0.002629896,
-0.0036529237,
0.037756175,
-0.016145365,
-0.0024103024,
0.025012769,
0.010059483,
0.022907458,
0.028205592,
0.057498693,
0.057721775,
0.0018421472,
-0.03680809,
-0.0369754,
0.0145559255,
-0.013872745,
-0.0074243587,
-0.014026112,
0.011411902,
0.022... | FLAN-T5 includes the same improvements as T5 version 1.1 (see here for the full details of the model's improvements.)
Google has released the following variants:
google/flan-t5-small
google/flan-t5-base
google/flan-t5-large
google/flan-t5-xl
google/flan-t5-xxl.
The original checkpoints can be found here.
Refer t... |
[
0.01759949,
-0.01651668,
0.015998151,
0.019826116,
0.010568845,
-0.025972212,
-0.027802315,
-0.003725022,
-0.022708528,
0.046454113,
-0.020969931,
0.022800034,
0.0098520545,
-0.026155222,
-0.0070878365,
-0.045600068,
0.020176886,
0.016928453,
-0.036846075,
-0.0015460558,
0.05... |
CTRL makes use of control codes to generate text: it requires generations to be started by certain words, sentences
or links to generate coherent text. Refer to the original implementation for
more information.
CTRL is a model with absolute position embeddings so it's usually advised to pad the inputs on the righ... |
[
-0.014637305,
-0.04074709,
-0.017703228,
0.02353837,
0.020599606,
-0.008272338,
-0.021136494,
-0.016375132,
-0.018042315,
0.047641885,
-0.004114976,
0.0021104706,
0.01368362,
-0.046115987,
0.0067323125,
0.0022340964,
-0.01511768,
-0.025205553,
-0.06651779,
-0.013839035,
0.007... | Resources
Text classification task guide
Causal language modeling task guide
CTRLConfig
[[autodoc]] CTRLConfig
CTRLTokenizer
[[autodoc]] CTRLTokenizer
- save_vocabulary
CTRLModel
[[autodoc]] CTRLModel
- forward
CTRLLMHeadModel
[[autodoc]] CTRLLMHeadModel
- forward
CTRLForSequenceClassification
[[autodoc]... |
[
0.0037351185,
-0.023847584,
0.008952248,
0.0129469065,
0.010772789,
-0.04035282,
0.0057249246,
-0.014285982,
-0.025036203,
0.03556826,
-0.010893155,
0.011043613,
0.016490191,
-0.04919975,
0.004461078,
-0.012224708,
0.0019898063,
0.0074326224,
-0.053713486,
-0.0031784242,
0.03... |
Overview
CTRL model was proposed in CTRL: A Conditional Transformer Language Model for Controllable Generation by Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong and
Richard Socher. It's a causal (unidirectional) transformer pre-trained using language modeling on a very large corpus
of ~140 GB of ... |
[
-0.006049923,
-0.038004518,
0.013069209,
0.008985511,
0.04394444,
0.0029459002,
0.0014127946,
0.00093498814,
0.006342107,
0.061159223,
0.022728462,
0.03066211,
0.020418491,
-0.03701453,
-0.032037094,
0.034154568,
0.009796751,
-0.049801867,
-0.047134403,
-0.01182485,
0.0262346... | CTRLModel
[[autodoc]] CTRLModel
- forward
CTRLLMHeadModel
[[autodoc]] CTRLLMHeadModel
- forward
CTRLForSequenceClassification
[[autodoc]] CTRLForSequenceClassification
- forward
TFCTRLModel
[[autodoc]] TFCTRLModel
- call
TFCTRLLMHeadModel
[[autodoc]] TFCTRLLMHeadModel
- call
TFCTRLForSequenceClassi... |
[
0.023110589,
-0.01588761,
-0.0117686,
-0.020889265,
-0.0044904565,
-0.061608624,
0.012813063,
-0.01499761,
-0.0021459307,
0.06460962,
-0.02706778,
-0.020315547,
0.029877534,
-0.028391749,
0.009709096,
-0.022845795,
-0.017520504,
-0.020815711,
-0.07490714,
-0.0015924387,
0.032... |
GIT
Overview
The GIT model was proposed in GIT: A Generative Image-to-text Transformer for Vision and Language by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages CLIP's vision encoder to condition the model on ... |
[
0.050753754,
0.0072821807,
-0.014315162,
-0.045409795,
0.0024850788,
-0.050393797,
0.030568546,
-0.01916072,
-0.013671394,
0.08345435,
-0.033586636,
-0.012480772,
0.036826238,
-0.06362909,
-0.017997785,
0.008424348,
-0.020711297,
-0.009407304,
-0.056568425,
0.042751662,
0.061... | GIT architecture. Taken from the original paper.
This model was contributed by nielsr.
The original code can be found here.
Usage tips
GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on pixel_values.
Resources
A list of official Hugging Face and communi... |
[
0.0074810353,
-0.00991752,
-0.021550873,
-0.013822758,
-0.029594703,
-0.043486092,
0.037034556,
0.013767851,
-0.004564118,
0.05644407,
-0.021386152,
0.017336786,
0.030253582,
-0.05224371,
-0.008455629,
0.010116557,
0.003757676,
-0.03264202,
-0.041976158,
0.0028156834,
-0.0042... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with GIT.
Demo notebooks regarding inference + fine-tuning GIT on custom data can be found here.
See also: Causal language modeling task guide |
[
0.013595265,
-0.009666596,
-0.025833588,
0.016890695,
-0.045231394,
-0.0366762,
-0.028586242,
0.03897654,
-0.0023665712,
0.06632215,
0.010584147,
0.010577685,
0.03135182,
-0.02190492,
-0.011152769,
0.030989967,
0.012380479,
-0.028146852,
-0.03941593,
-0.015288211,
0.012134938... |
If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.
GitVisionConfig
[[autodoc]] GitVisionConfig
GitVisionModel
[[autodoc]] GitVisionModel
... |
[
0.00016472864,
0.0051608067,
-0.008678702,
0.01541243,
-0.0017101389,
-0.038162712,
-0.033418156,
-0.050863966,
0.0030648045,
0.04838855,
-0.015206146,
-0.021055797,
0.0019210284,
-0.0402845,
0.019950699,
-0.016723813,
-0.021262081,
-0.036453493,
-0.05929218,
-0.028879888,
0.... |
CLAP
Overview
The CLAP model was proposed in Large Scale Contrastive Language-Audio pretraining with
feature fusion and keyword-to-caption augmentation by Yusong Wu, Ke Chen, Tianyu Zhang, Yuchen Hui, Taylor Berg-Kirkpatrick, Shlomo Dubnov.
CLAP (Contrastive Language-Audio Pretraining) is a neural network trained on a... |
[
0.01960428,
0.03651184,
0.008824957,
0.05332849,
-0.035087723,
-0.051934678,
-0.04223859,
0.009097659,
-0.029088268,
0.010483896,
-0.017998366,
0.0044995914,
0.022543408,
-0.016771205,
-0.022922162,
-0.007378118,
0.0032515987,
-0.024361424,
-0.048298646,
-0.0053896625,
-0.042... | CLVP is an integral part of the Tortoise TTS model.
CLVP can be used to compare different generated speech candidates with the provided text, and the best speech tokens are forwarded to the diffusion model.
The use of the [ClvpModelForConditionalGeneration.generate()] method is strongly recommended for tortoise usage.
... |
[
0.026741587,
0.030573802,
-0.009748371,
0.005549019,
0.002201076,
-0.039357126,
-0.05863009,
-0.014377799,
-0.003954594,
0.023566723,
0.03890957,
-0.020251997,
0.03409832,
-0.0622665,
-0.011937209,
-0.03160878,
0.0005345345,
-0.06573507,
-0.03583261,
-0.019147089,
-0.02836398... |
The [ClvpTokenizer] tokenizes the text input, and the [ClvpFeatureExtractor] extracts the log mel-spectrogram from the desired audio.
[ClvpConditioningEncoder] takes those text tokens and audio representations and converts them into embeddings conditioned on the text and audio.
The [ClvpForCausalLM] uses those embedd... |
[
0.0019744847,
0.019863814,
0.0028072605,
0.00933323,
-0.012764112,
-0.0543415,
-0.038346063,
-0.024300167,
-0.033525944,
0.016394554,
-0.027262853,
-0.03521452,
0.041231997,
-0.028352754,
0.0014516012,
0.00445938,
-0.000797757,
-0.016839724,
-0.044210035,
0.012672008,
-0.0384... |
CLVP
Overview
The CLVP (Contrastive Language-Voice Pretrained Transformer) model was proposed in Better speech synthesis through scaling by James Betker.
The abstract from the paper is the following:
In recent years, the field of image generation has been revolutionized by the application of autoregressive transformer... |
[
0.020842394,
-0.007600846,
0.016809292,
-0.00061210425,
-0.050512485,
-0.014679926,
0.017570786,
0.012339035,
0.0095962435,
0.029782906,
0.033703193,
0.03502876,
-0.008891156,
0.005584295,
-0.0667295,
0.0273292,
-0.033703193,
-0.034944147,
-0.06616543,
-0.024607562,
0.0111685... | Example :
thon |
[
0.013549056,
-0.009931169,
-0.012222978,
0.016374178,
-0.030470962,
-0.017858809,
-0.02608914,
0.012460807,
-0.0021710922,
0.022514496,
0.029634956,
0.0065042675,
0.0073402734,
-0.055983547,
-0.002807105,
0.027472872,
-0.0009369028,
-0.035746444,
-0.06653451,
-0.014075163,
-0... |
ClvpConfig
[[autodoc]] ClvpConfig
- from_sub_model_configs
ClvpEncoderConfig
[[autodoc]] ClvpEncoderConfig
ClvpDecoderConfig
[[autodoc]] ClvpDecoderConfig
ClvpTokenizer
[[autodoc]] ClvpTokenizer
- save_vocabulary
ClvpFeatureExtractor
[[autodoc]] ClvpFeatureExtractor
- call
ClvpProcessor
[[autodoc]] ClvpPr... |
[
-0.00014486792,
0.027019508,
0.011116855,
0.005472163,
-0.004954577,
-0.040776804,
-0.008641442,
-0.034385737,
-0.005603435,
0.00055556145,
0.000799821,
-0.016277716,
0.056169372,
-0.04452743,
-0.0069199046,
0.016742794,
-0.022458747,
-0.06409069,
-0.071111865,
-0.02499417,
-... |
import datasets
from transformers import ClvpProcessor, ClvpModelForConditionalGeneration
Define the Text and Load the Audio (We are taking an audio example from HuggingFace Hub using datasets library).
text = "This is an example text."
ds = datasets.load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", ... |
[
0.010727232,
0.0046743746,
-0.039037444,
-0.03431541,
-0.035576575,
-0.011651108,
-0.021674434,
-0.0053379526,
-0.03235034,
0.07074254,
0.02165977,
0.011357814,
0.015163305,
0.008380879,
0.010382611,
-0.008036259,
0.024299417,
-0.010030658,
-0.028420199,
-0.020046651,
0.02363... |
DETR uses so-called object queries to detect objects in an image. The number of queries determines the maximum
number of objects that can be detected in a single image, and is set to 100 by default (see parameter
num_queries of [~transformers.DetrConfig]). Note that it's good to have some slack (in COCO, the
au... |
[
-0.008139617,
-0.010228856,
-0.014806951,
-0.07156693,
-0.044252593,
0.013601082,
-0.0136922235,
0.021158798,
-0.015732385,
0.053983677,
0.027650861,
-0.056984328,
0.0392889,
-0.0023013172,
0.008854725,
0.04683259,
-0.025183035,
-0.024285644,
-0.04262607,
-0.031633034,
0.0257... | There are three ways to instantiate a DETR model (depending on what you prefer):
Option 1: Instantiate DETR with pre-trained weights for entire model
from transformers import DetrForObjectDetection
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
Option 2: Instantiate DETR with randomly initi... |
[
0.01711811,
-0.011238411,
-0.00021804657,
-0.037034657,
-0.0100847995,
-0.024903128,
-0.008172036,
-0.012027333,
0.015748661,
0.049627632,
0.02283407,
0.013389339,
0.013821012,
-0.0044358233,
-0.017698636,
0.025870673,
-0.004956809,
-0.010531358,
-0.060166433,
-0.008566497,
0... |
As a summary, consider the following table:
| Task | Object detection | Instance segmentation | Panoptic segmentation |
|------|------------------|-----------------------|-----------------------|
| Description | Predicting bounding boxes and class labels around objects in an image | Predicting masks around objects (i... |
[
-0.0015605353,
-0.0040799975,
-0.0355277,
-0.03083151,
-0.0025942074,
-0.030685665,
-0.032727487,
-0.011456079,
0.005888468,
0.069888644,
0.0060525434,
-0.012972861,
0.020870335,
0.003729971,
-0.004069059,
-0.00659946,
0.005647825,
-0.009953882,
-0.05720018,
-0.0053707208,
0.... |
DETR
Overview
The DETR model was proposed in End-to-End Object Detection with Transformers by
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko. DETR
consists of a convolutional backbone followed by an encoder-decoder Transformer which can be trained end-to-end... |
[
-0.011569209,
-0.008598831,
-0.009237323,
-0.058796845,
-0.059407577,
0.009195683,
-0.025081657,
0.005090591,
-0.036616165,
0.043001093,
0.011291604,
-0.06046248,
0.013470807,
-0.009514929,
0.008480848,
0.030897493,
-0.046026994,
-0.018308083,
-0.041418742,
-0.016892295,
0.02... | Option 2: Instantiate DETR with randomly initialized weights for Transformer, but pre-trained weights for backbone
from transformers import DetrConfig, DetrForObjectDetection
config = DetrConfig()
model = DetrForObjectDetection(config)
Option 3: Instantiate DETR with randomly initialized weights for backbone + Transfo... |
[
-0.0035394584,
-0.026302705,
0.0041131526,
-0.01219855,
-0.043802053,
-0.035454974,
-0.025645137,
0.014560426,
0.0031972548,
0.05426946,
0.011480594,
0.008447731,
0.05461837,
0.0008118947,
0.004596263,
0.009360273,
0.016251314,
-0.023484558,
-0.055987187,
-0.013708272,
-0.009... | All example notebooks illustrating fine-tuning [DetrForObjectDetection] and [DetrForSegmentation] on a custom dataset an be found here.
See also: Object detection task guide |
[
0.012248011,
-0.0054443157,
-0.0197246,
-0.003357668,
-0.060519584,
-0.038497634,
-0.046137348,
-0.0048733763,
-0.0077552614,
0.06775148,
-0.00056966505,
-0.008332998,
0.033957306,
-0.013301531,
-0.0056924024,
0.017413653,
0.03278824,
-0.026045715,
-0.05173799,
-0.023027893,
... |
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 duplicating an existing resource.
DetrConfig
[[autodoc]] DetrConfig
DetrImageProcessor
[[autodoc]] DetrImageProcessor
- p... |
[
-0.0034928306,
-0.0016713358,
0.00786703,
0.01816272,
0.010667823,
-0.03407958,
-0.016399981,
-0.04345473,
-0.00046271845,
0.0655477,
0.037683398,
0.00820652,
0.033139456,
-0.017248707,
-0.012064955,
0.024586916,
-0.029405063,
-0.026924174,
-0.053639434,
0.046980206,
0.013227... | XLNet |
[
0.018734036,
-0.0071976725,
-0.029433459,
0.010337867,
-0.0077333134,
0.000023342744,
-0.008717554,
-0.02023383,
-0.0031234552,
0.05217141,
-0.008315823,
-0.009782139,
0.022403175,
-0.04716317,
0.009983005,
-0.016765555,
-0.030799344,
-0.018600125,
-0.055438817,
-0.036316443,
... | Resources
Text classification task guide
Token classification task guide
Question answering task guide
Causal language modeling task guide
Multiple choice task guide |
[
0.04340444,
0.0475325,
0.01249635,
0.022494927,
-0.013947153,
-0.006001389,
-0.021358214,
-0.03649443,
-0.03434066,
0.05246822,
0.022509884,
0.03634486,
0.014208896,
-0.020475768,
-0.021432998,
0.014724904,
-0.011875646,
-0.023751292,
-0.07693744,
0.031050177,
0.008704819,
... |
The specific attention pattern can be controlled at training and test time using the perm_mask input.
Due to the difficulty of training a fully auto-regressive model over various factorization order, XLNet is pretrained
using only a sub-set of the output tokens as target which are selected with the target_mapping i... |
[
0.023134286,
0.007455801,
-0.02037919,
0.008052265,
-0.005339774,
-0.032351077,
-0.010580136,
-0.04476321,
-0.013981402,
0.0846979,
0.045047242,
-0.0007904037,
0.021444304,
-0.035304993,
0.0033994904,
0.0026024296,
-0.028232634,
-0.030675296,
-0.043229446,
0.0069836006,
-0.00... |
Overview
The XLNet model was proposed in XLNet: Generalized Autoregressive Pretraining for Language Understanding by Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov,
Quoc V. Le. XLnet is an extension of the Transformer-XL model pre-trained using an autoregressive method to learn
bidirectio... |
[
0.010784725,
-0.025921298,
0.009788273,
0.017773442,
0.014316366,
0.0039620814,
-0.0023216645,
-0.010337338,
0.023291208,
0.08096339,
0.03988518,
0.029337704,
0.04972768,
-0.009354443,
-0.033404853,
0.066538565,
-0.020810248,
-0.054093085,
-0.046609532,
0.0033333679,
0.019929... |
XLNetModel
[[autodoc]] XLNetModel
- forward
XLNetLMHeadModel
[[autodoc]] XLNetLMHeadModel
- forward
XLNetForSequenceClassification
[[autodoc]] XLNetForSequenceClassification
- forward
XLNetForMultipleChoice
[[autodoc]] XLNetForMultipleChoice
- forward
XLNetForTokenClassification
[[autodoc]] XLNetForTo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.