vector listlengths 1.02k 1.02k | text stringlengths 2 11.8k |
|---|---|
[
0.0062701497,
0.03742659,
-0.02908632,
0.028652865,
-0.0049623116,
0.0041776085,
0.006901649,
-0.021403706,
0.018160267,
0.022270614,
0.015126082,
-0.021314025,
0.04026647,
-0.047351215,
-0.019460632,
0.010402918,
-0.039967533,
-0.04750068,
-0.03673904,
-0.024632197,
0.011598... | The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code
thon
from datasets import load_dataset
from transformers import pipeline
librispeech_en = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
asr = pipeline(
"automatic-... |
[
-0.010879627,
-0.022266295,
-0.02766989,
0.047545854,
0.0071999663,
-0.030828025,
-0.023454215,
-0.037463002,
-0.010770976,
0.06495905,
-0.0021531086,
-0.0076128417,
0.020600306,
-0.058903545,
-0.0035112512,
0.041606244,
-0.026786193,
-0.022396676,
-0.04635793,
-0.019919423,
... | See model hub to look for Speech2Text2 checkpoints.
Resources
Causal language modeling task guide
Speech2Text2Config
[[autodoc]] Speech2Text2Config
Speech2TextTokenizer
[[autodoc]] Speech2Text2Tokenizer
- batch_decode
- decode
- save_vocabulary
Speech2Text2Processor
[[autodoc]] Speech2Text2Processor
-... |
[
0.0148664145,
-0.017314518,
-0.0015847706,
-0.0008282863,
0.0146886185,
-0.018641142,
0.03662581,
-0.040291127,
0.01567333,
0.06980513,
0.01131051,
0.036324926,
0.0024737467,
-0.028501939,
0.003504617,
0.012869637,
0.020063505,
-0.024152795,
-0.03733699,
-0.0042363126,
-0.031... |
LayoutXLM
Overview
LayoutXLM was proposed in LayoutXLM: Multimodal Pre-training for Multilingual Visually-rich Document Understanding by Yiheng Xu, Tengchao Lv, Lei Cui, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha
Zhang, Furu Wei. It's a multilingual extension of the LayoutLMv2 model trained
on 53 languages.
The abst... |
[
0.0012089146,
0.031583756,
-0.040702425,
0.030588992,
-0.014437893,
-0.013912879,
-0.02133216,
-0.005488472,
0.015405025,
0.041061644,
0.018886698,
0.0031967154,
-0.012966472,
-0.048024993,
-0.03730365,
0.017891934,
-0.03567334,
-0.03984582,
-0.042581424,
-0.0070151584,
0.010... | Speech Translation via Pipelines
The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code
thon |
[
0.014925708,
-0.0044376575,
-0.019085793,
0.007996919,
0.0015934106,
-0.010224531,
-0.0041811657,
-0.01995716,
0.027602721,
0.0696533,
0.013021345,
0.04820638,
0.0019342283,
-0.048459362,
-0.020097705,
0.04691338,
0.012578634,
-0.06307587,
-0.041347865,
0.030750893,
-0.037581... | As LayoutXLM's architecture is equivalent to that of LayoutLMv2, one can refer to LayoutLMv2's documentation page for all tips, code examples and notebooks.
LayoutXLMTokenizer
[[autodoc]] LayoutXLMTokenizer
- call
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from... |
[
0.053075783,
-0.022017466,
-0.020391824,
0.024256289,
0.022045985,
-0.013318855,
0.006998103,
-0.043521572,
-0.0075007686,
0.02628121,
0.02532579,
-0.031742796,
0.016541619,
-0.063827835,
0.01840968,
0.019792903,
0.0009304661,
-0.037304204,
-0.04198149,
-0.014124546,
0.000667... |
MegatronBERT
Overview
The MegatronBERT 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.026277013,
-0.0054051275,
-0.016376568,
0.023024624,
-0.020617569,
-0.031520955,
-0.023397146,
0.010330277,
-0.008338725,
0.07181047,
0.01836812,
-0.02080383,
0.04679429,
-0.047281433,
-0.032552548,
0.05467453,
0.03510288,
-0.027709784,
-0.00023349684,
0.003666102,
0.004531... | wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/megatron_bert_345m/versions/v0.1_uncased/zip
-O megatron_bert_345m_v0_1_uncased.zip
BERT-345M-cased: |
[
0.027711429,
-0.0138060525,
-0.008144578,
-0.008144578,
0.013550648,
-0.014323956,
0.037402626,
-0.0016698868,
0.037885055,
0.04322018,
0.0121104475,
0.0051719486,
-0.00229687,
-0.033372905,
-0.014203349,
0.052755296,
0.0024494037,
-0.04239721,
-0.05255665,
0.01604794,
-0.033... | Note that LayoutXLM has its own tokenizer, based on
[LayoutXLMTokenizer]/[LayoutXLMTokenizerFast]. You can initialize it as
follows:
thon
from transformers import LayoutXLMTokenizer
tokenizer = LayoutXLMTokenizer.from_pretrained("microsoft/layoutxlm-base")
Similar to LayoutLMv2, you can use [LayoutXLMProcessor] (which... |
[
0.05159564,
-0.01964753,
-0.009948997,
0.022374807,
-0.017198546,
-0.034786705,
0.0022715717,
-0.002880339,
-0.02226349,
0.05190176,
-0.002024586,
-0.020245861,
0.039629012,
-0.065844275,
-0.01661413,
0.037207857,
0.011430911,
-0.033812676,
-0.004623153,
-0.01907703,
-0.00444... | python3 $PATH_TO_TRANSFORMERS/models/megatron_bert/convert_megatron_bert_checkpoint.py megatron_bert_345m_v0_1_uncased.zip
python3 $PATH_TO_TRANSFORMERS/models/megatron_bert/convert_megatron_bert_checkpoint.py megatron_bert_345m_v0_1_cased.zip
Resources
Text classification task guide
Token classification task guide
Q... |
[
0.034374017,
0.0017056103,
-0.0006285347,
0.03363479,
-0.015138735,
-0.050174974,
0.00033760883,
-0.0051360815,
0.006302673,
0.064374276,
0.003474748,
-0.011373302,
0.07016488,
-0.058275662,
-0.02796739,
0.057875246,
0.012335836,
-0.034404818,
-0.01751042,
-0.0066607357,
0.00... |
wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/megatron_bert_345m/versions/v0.1_cased/zip -O
megatron_bert_345m_v0_1_cased.zip
Once you have obtained the checkpoints from NVIDIA GPU Cloud (NGC), you have to convert them to a format that will
easily be loaded by Hugging Face Transformers and ou... |
[
0.02317511,
-0.012131572,
0.0015121963,
-0.0058345785,
-0.024412747,
0.0141172325,
0.0036075104,
0.013369209,
-0.011023138,
0.045915008,
0.045860603,
0.00085130107,
0.032096982,
-0.023691926,
-0.026928825,
0.04479977,
-0.024915963,
-0.044636566,
-0.057339355,
-0.03976762,
0.0... |
MegatronBertConfig
[[autodoc]] MegatronBertConfig
MegatronBertModel
[[autodoc]] MegatronBertModel
- forward
MegatronBertForMaskedLM
[[autodoc]] MegatronBertForMaskedLM
- forward
MegatronBertForCausalLM
[[autodoc]] MegatronBertForCausalLM
- forward
MegatronBertForNextSentencePrediction
[[autodoc]] Megatron... |
[
0.033166435,
0.010545368,
-0.011769632,
0.033945512,
-0.020353395,
0.0056691784,
0.0065212944,
0.0025406964,
-0.0030519657,
0.034279402,
0.049165342,
-0.039009515,
0.0043336176,
0.0035927985,
-0.055008423,
0.018836977,
-0.013703413,
-0.021021176,
-0.028658915,
0.02451311,
0.0... | XLM-ProphetNet |
[
-0.0034054152,
-0.026956275,
-0.027138943,
0.019936685,
0.009557344,
-0.02608209,
-0.022846293,
-0.026799705,
-0.01867107,
0.046658102,
0.020928299,
-0.012623522,
0.023864003,
-0.038124993,
-0.0027024776,
0.026055994,
-0.036559287,
-0.034810912,
-0.07390143,
0.0052385987,
0.0... | Causal language modeling task guide
Translation task guide
Summarization task guide
XLMProphetNetConfig
[[autodoc]] XLMProphetNetConfig
XLMProphetNetTokenizer
[[autodoc]] XLMProphetNetTokenizer
XLMProphetNetModel
[[autodoc]] XLMProphetNetModel
XLMProphetNetEncoder
[[autodoc]] XLMProphetNetEncoder
XLMProphetNetDecoder
... |
[
0.0644381,
0.0049961796,
0.0005136303,
0.007728117,
-0.04302802,
-0.01719339,
0.01098714,
-0.042701375,
-0.01749034,
0.044750325,
0.02883382,
-0.014350097,
0.013964062,
-0.030155247,
-0.018589053,
-0.0119596515,
-0.013117755,
-0.032397218,
-0.07008014,
0.013941791,
0.01581257... |
Phi
Overview
The Phi-1 model was proposed in Textbooks Are All You Need by Suriya Gunasekar, Yi Zhang, Jyoti Aneja, Caio César Teodoro Mendes, Allie Del Giorno, Sivakanth Gopi, Mojan Javaheripi, Piero Kauffmann, Gustavo de Rosa, Olli Saarikivi, Adil Salim, Shital Shah, Harkirat Singh Behl, Xin Wang, Sébastien Bubeck, ... |
[
0.021398345,
0.02314159,
-0.019248342,
-0.0047394503,
0.011265728,
0.0131832985,
-0.022342604,
0.011236673,
-0.0020247076,
0.06362848,
0.022095643,
0.022240914,
0.010626538,
-0.0244345,
-0.021935847,
0.04483048,
-0.012769277,
-0.03117505,
-0.032773025,
-0.0042927433,
0.011592... |
Overview
The Open-Llama model was proposed in the open source Open-Llama project by community developer s-JoL.
The model is mainly based on LLaMA with some modifications, incorporating memory-efficient attention from Xformers, stable embedding from Bloom, and shared input-output embedding from PaLM.
And the model is ... |
[
0.043149717,
-0.00851201,
-0.036711946,
0.0147208525,
0.015234209,
-0.0093861045,
-0.0074020494,
-0.027485399,
-0.03155063,
0.051696412,
0.04281673,
-0.01997929,
0.0054700244,
-0.030662661,
-0.03268834,
0.0019302908,
-0.010856802,
-0.026084073,
-0.053111613,
0.0010501267,
0.0... |
DISCLAIMER: If you see something strange, file a Github Issue and assign
@patrickvonplaten
Overview
The XLM-ProphetNet model was proposed in ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training, by Yu Yan, Weizhen Qi, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei
Zhang, Ming Zhou on ... |
[
0.02834385,
0.0059316363,
-0.023848455,
0.009981303,
0.012617585,
0.013973823,
0.0024515144,
0.014537652,
0.00088003086,
0.00588973,
-0.019505445,
0.023299864,
0.023589399,
-0.04236339,
-0.04501491,
0.05744963,
0.014552891,
-0.01277759,
-0.03992521,
0.022522693,
0.0027086663,... | Open-Llama
This model is in maintenance mode only, we don't accept any new PRs changing its code.
If you run into any issues running this model, please reinstall the last version that supported this model: v4.31.0.
You can do so by running the following command: pip install -U transformers==4.31.0.
This model differs... |
[
0.028028756,
-0.008294689,
-0.015305676,
-0.00061953807,
-0.053049546,
-0.00461449,
0.0068780594,
-0.012837018,
0.0012105915,
0.032054566,
0.03314837,
-0.013672564,
0.034394093,
-0.029487163,
-0.012138198,
0.04703362,
0.009426473,
-0.0021800143,
-0.04837049,
0.015586723,
0.04... | Phi-2 has been integrated in the development version (4.37.0.dev) of transformers. Until the official version is released through pip, ensure that you are doing one of the following:
When loading the model, ensure that trust_remote_code=True is passed as an argument of the from_pretrained() function. |
[
0.02576354,
0.0062814928,
-0.02350307,
-0.0075276485,
-0.04263011,
-0.047498807,
0.04929559,
-0.010773448,
-0.0033055723,
0.038514897,
0.005937351,
-0.010722733,
0.035153177,
-0.04680328,
0.0043832795,
0.015156728,
0.00096088,
-0.020387683,
-0.057583973,
-0.01215726,
0.021025... | When loading the model, ensure that trust_remote_code=True is passed as an argument of the from_pretrained() function.
Update your local transformers to the development version: pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers. The previous command is an alternative to cloni... |
[
0.026779585,
0.026243992,
-0.017808424,
0.038860153,
-0.03433738,
0.0016328108,
-0.021542689,
-0.0039499886,
-0.00089776696,
0.032998398,
0.005117876,
-0.006962692,
-0.00068436714,
-0.010072099,
-0.010667201,
0.0449897,
-0.013992333,
-0.05962921,
-0.045346763,
0.027672237,
0.... | This model is quite similar to Llama with the main difference in [PhiDecoderLayer], where they used [PhiAttention] and [PhiMLP] layers in parallel configuration.
The tokenizer used for this model is identical to the [CodeGenTokenizer].
How to use Phi-2
Phi-2 has been integrated in the development version (4.37.0.dev)... |
[
0.019814022,
0.006936992,
0.0025583848,
0.0063151987,
-0.01909149,
-0.011650812,
-0.0034163904,
0.017493587,
-0.0041406583,
0.05574604,
-0.010705964,
0.0017116689,
-0.004012131,
-0.024593843,
-0.015992945,
0.035598546,
0.004342133,
-0.044574603,
-0.012574818,
-0.0040295,
0.00... |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2")
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
inputs = tokenizer('Can you help me write a formal email to a potential business partner proposing a joint venture?', return_tensors... |
[
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.027775513,
0.022882342,
-0.03386701,
0.011976139,
-0.0378329,
-0.021042055,
-0.0351224,
0.0021059888,
0.03067147,
0.031299166,
-0.0191875,
-0.0049573653,
0.023923747,
0.0047861757,
-0.002910223,
0.04245502,
-0.018488476,
-0.053097308,
-0.010028858,
0.018973514,
0.025906693,... | Combining Phi and Flash Attention 2
First, make sure to install the latest version of Flash Attention 2 to include the sliding window attention feature. |
[
0.016404195,
0.025815483,
-0.043938767,
-0.038315304,
-0.011946217,
0.0138474135,
-0.012834899,
0.0153406905,
0.025072487,
0.055972397,
-0.015734041,
-0.0091272015,
0.03738292,
-0.056263767,
0.011800531,
0.06118794,
0.0005262891,
-0.034469206,
-0.0221005,
-0.020949585,
0.0345... | pip install -U flash-attn --no-build-isolation
Make also sure that you have a hardware that is compatible with Flash-Attention 2. Read more about it in the official documentation of flash-attn repository. Make also sure to load your model in half-precision (e.g. `torch.float16``)
To load and run a model using Flash Att... |
[
-0.0011633354,
-0.014316887,
-0.000082645834,
-0.019475488,
-0.03332598,
-0.003929017,
-0.021242132,
-0.022146655,
0.009264284,
0.07490572,
0.022909846,
-0.0025174683,
-0.009737744,
-0.035050225,
-0.007017112,
0.05494971,
-0.025609277,
-0.011299458,
-0.04200374,
0.021553062,
... | Expected speedups
Below is an expected speedup diagram that compares pure inference time between the native implementation in transformers using microsoft/phi-1 checkpoint and the Flash Attention 2 version of the model using a sequence length of 2048.
PhiConfig
[[autodoc]] PhiConfig |
[
0.033020426,
-0.0036536625,
-0.038837347,
-0.018246608,
-0.020055352,
0.0418471,
-0.006406571,
0.012617797,
-0.015193448,
0.042859994,
0.048127055,
-0.009955326,
0.008052528,
-0.052120764,
0.022732293,
0.054667473,
-0.012538212,
-0.012892726,
-0.053886097,
-0.014976399,
-0.00... |
Auto Classes
In many cases, the architecture you want to use can be guessed from the name or the path of the pretrained model you
are supplying to the from_pretrained() method. AutoClasses are here to do this job for you so that you
automatically retrieve the relevant model given the name/path to the pretrained weight... |
[
0.0044373055,
0.015057741,
-0.013821115,
-0.0052520237,
-0.042045288,
-0.011340588,
-0.024601584,
0.0054375175,
-0.026725672,
0.026027342,
0.0076670814,
-0.019640531,
-0.011587914,
-0.020135183,
-0.019946052,
0.017749222,
-0.012584489,
-0.059590828,
-0.051821906,
0.005499349,
... |
from transformers import PhiForCausalLM, AutoTokenizer
define the model and tokenizer.
model = PhiForCausalLM.from_pretrained("microsoft/phi-1_5")
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5")
feel free to change the prompt to your liking.
prompt = "If I were an AI that had just achieved"
apply the t... |
[
-0.0024071443,
-0.0020242278,
-0.0065922355,
-0.0054721627,
-0.036193192,
0.0238589,
0.027462024,
-0.0033096126,
0.007874247,
0.054222316,
0.04671918,
0.012246578,
0.04196899,
-0.043399446,
0.019486567,
0.045261733,
0.025842642,
-0.010114391,
-0.076326884,
0.0094463965,
-0.00... | You will then be able to use the auto classes like you would usually do!
If your NewModelConfig is a subclass of [~transformers.PretrainedConfig], make sure its
model_type attribute is set to the same key you use when registering the config (here "new-model").
Likewise, if your NewModel is a subclass of [PreTrainedMod... |
[
0.0031329738,
-0.0043777307,
-0.022922589,
0.0040220856,
-0.045639858,
-0.0012200082,
-0.022350624,
0.0019212151,
-0.01348517,
0.03376059,
0.0090707755,
-0.012451233,
0.008330154,
-0.032176685,
-0.004447393,
0.033467274,
-0.011732611,
-0.053295385,
-0.047135767,
0.0057819774,
... |
import torch
from transformers import PhiForCausalLM, AutoTokenizer
define the model and tokenizer and push the model and tokens to the GPU.
model = PhiForCausalLM.from_pretrained("microsoft/phi-1_5", torch_dtype=torch.float16, attn_implementation="flash_attention_2").to("cuda")
tokenizer = AutoTokenizer.from_pretrai... |
[
-0.021925492,
-0.0020789069,
0.008159114,
0.008860022,
-0.048696097,
0.012282903,
-0.017311748,
0.015379148,
0.0007098395,
0.064020805,
0.042762198,
-0.0089212665,
0.026008453,
-0.026484797,
-0.035902824,
0.029478967,
-0.02422556,
-0.034759596,
-0.03127547,
-0.0005954316,
0.0... | PhiConfig
[[autodoc]] PhiConfig
PhiModel
[[autodoc]] PhiModel
- forward
PhiForCausalLM
[[autodoc]] PhiForCausalLM
- forward
- generate
PhiForSequenceClassification
[[autodoc]] PhiForSequenceClassification
- forward
PhiForTokenClassification
[[autodoc]] PhiForTokenClassification
- forward |
[
0.020951558,
-0.023378873,
-0.024642212,
0.0009776684,
-0.02563585,
0.0009368583,
-0.019929532,
0.014116752,
-0.009971864,
0.07296139,
-0.030064635,
-0.0051704645,
-0.009915084,
-0.011547488,
0.010128006,
0.01359864,
-0.010447389,
-0.020823805,
-0.07051988,
-0.036651034,
0.00... |
InstructBLIP architecture. Taken from the original paper.
This model was contributed by nielsr.
The original code can be found here.
Usage tips
InstructBLIP uses the same architecture as BLIP-2 with a tiny but important difference: it also feeds the text prompt (instruction) to the Q-Former.
InstructBlipConfig
[[au... |
[
0.012823966,
-0.011393082,
-0.03274836,
0.013208685,
-0.011231095,
-0.006280369,
-0.007957608,
-0.008477317,
-0.0025614186,
0.052537765,
0.012182768,
0.004873107,
0.017913057,
-0.06760255,
-0.02296165,
0.024392534,
-0.04206261,
-0.047003213,
-0.043466497,
-0.017926555,
-0.005... | Text classification task guide
Token classification task guide
Question answering task guide
Masked language modeling task guide
Multiple choice task guide
MPNetConfig
[[autodoc]] MPNetConfig
MPNetTokenizer
[[autodoc]] MPNetTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_tok... |
[
0.0049932594,
-0.021649558,
-0.012019465,
0.009465081,
0.009663096,
0.022705633,
0.00025143684,
0.0005643406,
0.019550607,
0.08401085,
0.033952843,
0.0333456,
0.047206596,
-0.020725492,
-0.029649334,
0.056447264,
-0.008745629,
-0.083905235,
-0.028276434,
-0.02543823,
0.036381... | MPNetModel
[[autodoc]] MPNetModel
- forward
MPNetForMaskedLM
[[autodoc]] MPNetForMaskedLM
- forward
MPNetForSequenceClassification
[[autodoc]] MPNetForSequenceClassification
- forward
MPNetForMultipleChoice
[[autodoc]] MPNetForMultipleChoice
- forward
MPNetForTokenClassification
[[autodoc]] MPNetForToke... |
[
0.0015251312,
-0.01047056,
-0.0038479671,
-0.014449956,
-0.015070596,
0.008659751,
0.003931936,
0.02507385,
-0.0027837523,
0.046350844,
0.03431773,
-0.0017158866,
0.018867452,
-0.024212256,
-0.0069876746,
0.05698204,
-0.005180517,
-0.034405354,
-0.051023897,
-0.01601981,
0.01... |
AutoConfig
[[autodoc]] AutoConfig
AutoTokenizer
[[autodoc]] AutoTokenizer
AutoFeatureExtractor
[[autodoc]] AutoFeatureExtractor
AutoImageProcessor
[[autodoc]] AutoImageProcessor
AutoProcessor
[[autodoc]] AutoProcessor
Generic model classes
The following auto classes are available for instantiating a base model class ... |
[
0.027681142,
-0.020083832,
-0.0028361825,
-0.012588991,
-0.0040694647,
-0.0369765,
0.011461837,
-0.0021042645,
-0.008790337,
0.06317917,
0.0026074583,
-0.013840571,
0.010890941,
-0.048862852,
0.015194619,
0.010349322,
0.0059834304,
-0.04031405,
-0.068566084,
-0.026685733,
0.0... |
InstructBLIP
Overview
The InstructBLIP model was proposed in InstructBLIP: Towards General-purpose Vision-Language Models with Instruction Tuning by Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, Steven Hoi.
InstructBLIP leverages the BLIP-2 architectur... |
[
0.050365157,
-0.017517686,
-0.03851283,
0.008360384,
0.018676838,
-0.026225816,
-0.016764237,
-0.03874466,
-0.018546434,
0.054016486,
0.05758088,
-0.0038940266,
0.015503659,
-0.0445694,
-0.023516297,
0.034716606,
-0.004158458,
-0.030833445,
-0.01887969,
-0.00093818875,
0.0108... |
MPNet
Overview
The MPNet model was proposed in MPNet: Masked and Permuted Pre-training for Language Understanding by Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, Tie-Yan Liu.
MPNet adopts a novel pre-training method, named masked and permuted language modeling, to inherit the advantages of
masked language modeling and p... |
[
0.020015707,
-0.020286575,
0.0012554367,
-0.014740912,
0.028027691,
-0.011027171,
-0.004864929,
-0.005991169,
-0.023665294,
0.07943555,
0.006668338,
-0.03085042,
0.053375218,
-0.031734303,
0.017848764,
-0.0041378625,
0.014883474,
-0.013864156,
-0.03951819,
-0.010449795,
0.005... |
ConvNeXT
Overview
The ConvNeXT model was proposed in A ConvNet for the 2020s by Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, Saining Xie.
ConvNeXT is a pure convolutional model (ConvNet), inspired by the design of Vision Transformers, that claims to outperform them.
The abstract from t... |
[
0.010713226,
-0.028129626,
-0.012780806,
0.0127873905,
-0.0077435486,
0.010416917,
0.0035129108,
0.0059294775,
0.0090868175,
0.06342335,
0.031211242,
0.028340334,
0.05249283,
-0.010199623,
-0.04572381,
0.05159732,
-0.00998233,
-0.07954258,
-0.0335027,
-0.037400812,
0.02446856... | TFMPNetModel
[[autodoc]] TFMPNetModel
- call
TFMPNetForMaskedLM
[[autodoc]] TFMPNetForMaskedLM
- call
TFMPNetForSequenceClassification
[[autodoc]] TFMPNetForSequenceClassification
- call
TFMPNetForMultipleChoice
[[autodoc]] TFMPNetForMultipleChoice
- call
TFMPNetForTokenClassification
[[autodoc]] TFMPNe... |
[
0.04044664,
-0.009265405,
-0.011529317,
-0.016794901,
0.027890243,
-0.02491027,
0.03205642,
0.002017992,
-0.03043624,
0.053842057,
-0.015030064,
-0.024042314,
0.03564396,
-0.07232947,
-0.028165095,
-0.015247052,
0.0031481402,
-0.04336875,
-0.050225582,
-0.0010198455,
0.024852... | ConvNeXT architecture. Taken from the original paper.
This model was contributed by nielsr. TensorFlow version of the model was contributed by ariG23498,
gante, and sayakpaul (equal contribution). The original code can be found here.
Resources
A list of official Hugging Face and community (indicated by 🌎) resources to... |
[
0.02903206,
-0.02614199,
-0.0147919,
-0.007336835,
-0.028191313,
-0.036519967,
-0.027192924,
0.015842834,
-0.0043515246,
0.059640523,
0.024644408,
-0.0136621455,
0.046372477,
-0.04931509,
-0.0035764608,
0.017931566,
0.027061557,
-0.041800912,
-0.056224983,
-0.023790525,
0.004... | 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.
ConvNextConfig
[[autodoc]] ConvNextConfig
ConvNextFeatureExtractor
[[autodoc]] ConvNextFeatur... |
[
-0.0068395026,
-0.034588646,
-0.015631136,
0.0048908964,
0.021959702,
-0.0054405937,
0.0025899198,
0.019450827,
-0.020451559,
0.06331385,
0.012939028,
0.007730999,
0.051812492,
-0.045187935,
-0.04005743,
0.009598561,
-0.0018393717,
-0.044680525,
-0.05122051,
0.0006069574,
0.0... | ConvNextModel
[[autodoc]] ConvNextModel
- forward
ConvNextForImageClassification
[[autodoc]] ConvNextForImageClassification
- forward
TFConvNextModel
[[autodoc]] TFConvNextModel
- call
TFConvNextForImageClassification
[[autodoc]] TFConvNextForImageClassification
- call |
[
0.046228733,
-0.012499101,
-0.010832056,
-0.003713474,
0.04036791,
-0.023697458,
0.004687163,
-0.015100589,
0.008282897,
0.04425519,
0.0025342077,
-0.040696833,
0.023787165,
-0.06129942,
0.015294952,
0.015593974,
0.0020875442,
-0.034686502,
-0.026418556,
-0.03621151,
0.014248... |
SegFormer
Overview
The SegFormer model was proposed in SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez, Ping
Luo. The model consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to ... |
[
0.048067898,
0.023113856,
-0.02751915,
0.018792206,
0.0064127706,
-0.044052947,
0.0024100167,
0.02629236,
-0.008015963,
0.06317973,
0.020339636,
-0.011675425,
0.047175687,
-0.057380356,
0.0029397674,
0.0056181448,
0.006939036,
-0.03649703,
-0.05208285,
-0.010121025,
0.0801875... | This model was contributed by nielsr. The TensorFlow version
of the model was contributed by sayakpaul. The original code can be found here.
Usage tips |
[
0.03718893,
-0.007025055,
-0.009814944,
-0.0021804995,
-0.0060938937,
0.0041992143,
0.009016805,
0.031954292,
-0.00908871,
0.050304282,
0.001723008,
-0.012842117,
0.056171678,
-0.039950058,
-0.015099914,
0.038885873,
0.014323346,
-0.03368,
-0.03491675,
-0.060112037,
-0.014035... | [SegformerForImageClassification] is supported by this example script and notebook.
Image classification task guide
Semantic segmentation:
[SegformerForSemanticSegmentation] is supported by this example script.
A blog on fine-tuning SegFormer on a custom dataset can be found here.
More demo notebooks on SegFormer (bo... |
[
0.07520303,
-0.020886397,
0.017915487,
-0.02037624,
-0.006354446,
-0.031059513,
0.0072509707,
-0.00039129172,
-0.032349907,
0.029934168,
0.034360524,
0.002327588,
0.052486073,
-0.047654595,
-0.011433502,
0.042793106,
0.015439728,
-0.03745147,
-0.059808318,
-0.019370932,
0.027... |
| Model variant | Depths | Hidden sizes | Decoder hidden size | Params (M) | ImageNet-1k Top 1 |
| :---------------: | ------------- | ------------------- | :---------------------: | :------------: | :-------------------: |
| MiT-b0 | [2, 2, 2, 2] | [32, 64, 160, 256] | 256 | 3.... |
[
0.042387407,
-0.0026859147,
-0.015788509,
0.020085972,
-0.02120705,
-0.021353858,
-0.02220801,
0.017430086,
0.005261724,
0.039931715,
-0.008901889,
-0.011964833,
0.04804618,
-0.060538184,
0.0012445295,
0.035474095,
0.039024174,
-0.031577017,
-0.049354102,
-0.044229176,
-0.008... | 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.
SegformerConfig
[[autodoc]] SegformerConfig
SegformerFeatureExtractor
[[autodoc]] SegformerFe... |
[
0.05657285,
-0.008437882,
-0.0028845698,
-0.018287083,
0.04576275,
-0.014458507,
-0.027010232,
-0.009924271,
0.0024228885,
0.040808123,
-0.015719686,
-0.016095035,
0.037414953,
-0.06630194,
0.0120787835,
0.021905463,
-0.0023778463,
-0.027926087,
-0.053119622,
-0.04333048,
-0.... |
SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decoder head.
[SegformerModel] is the hierarchical Transformer encoder (which in the paper is also referred to
as Mix Transformer or MiT). [SegformerForSemanticSegmentation] adds the all-MLP decoder head on
top to perform semant... |
[
0.0100486735,
-0.03040261,
0.004334314,
0.010922471,
0.009410663,
-0.0042857695,
0.021151451,
0.020652138,
0.007989007,
0.058308657,
-0.000060680395,
0.0020093878,
0.048266917,
-0.03983408,
-0.004160941,
0.062081244,
0.003240333,
-0.0412488,
-0.06185933,
-0.04041661,
0.033925... | SegformerModel
[[autodoc]] SegformerModel
- forward
SegformerDecodeHead
[[autodoc]] SegformerDecodeHead
- forward
SegformerForImageClassification
[[autodoc]] SegformerForImageClassification
- forward
SegformerForSemanticSegmentation
[[autodoc]] SegformerForSemanticSegmentation
- forward |
[
0.013716743,
0.008886404,
-0.025671834,
0.0058603385,
0.014377364,
-0.03702313,
0.008424681,
-0.030203829,
-0.0056152698,
0.04401292,
0.025203006,
0.0073236474,
0.0028502555,
-0.017943291,
-0.012132676,
0.007693026,
-0.02901045,
-0.020599978,
-0.040745337,
-0.0018238084,
-0.0... |
XLS-R
Overview
The XLS-R model was proposed in XLS-R: Self-supervised Cross-lingual Speech Representation Learning at Scale by Arun Babu, Changhan Wang, Andros Tjandra, Kushal Lakhotia, Qiantong Xu, Naman
Goyal, Kritika Singh, Patrick von Platen, Yatharth Saraf, Juan Pino, Alexei Baevski, Alexis Conneau, Michael Auli.... |
[
0.011295403,
-0.017543195,
-0.0010621588,
0.016377306,
0.018777665,
-0.026568545,
0.039557915,
0.024360215,
0.0066627106,
0.046690412,
0.008600144,
-0.000004349981,
0.07286118,
-0.014758779,
-0.0042554936,
0.02677429,
0.005613411,
-0.03684208,
-0.04584,
0.0035628185,
0.033989... | TFSegformerDecodeHead
[[autodoc]] TFSegformerDecodeHead
- call
TFSegformerModel
[[autodoc]] TFSegformerModel
- call
TFSegformerForImageClassification
[[autodoc]] TFSegformerForImageClassification
- call
TFSegformerForSemanticSegmentation
[[autodoc]] TFSegformerForSemanticSegmentation
- call |
[
0.03108601,
-0.009498503,
-0.015262553,
0.05148528,
-0.017388092,
-0.028473368,
0.018775595,
-0.036134165,
-0.010457948,
0.04670282,
0.027159667,
0.0014908296,
-0.011203363,
-0.02315952,
-0.04755894,
0.018539425,
0.0055647795,
-0.03191261,
-0.051780496,
0.0026827552,
0.009166... |
XLM-V
Overview
XLM-V is multilingual language model with a one million token vocabulary trained on 2.5TB of data from Common Crawl (same as XLM-R).
It was introduced in the XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models
paper by Davis Liang, Hila Gonen, Yuning Mao, Rui Hou, Naman Go... |
[
0.0018680155,
-0.0014797358,
-0.0046222005,
0.031864945,
0.0050717876,
0.010827245,
-0.0054582097,
-0.0038419256,
-0.009742291,
0.015590638,
0.016735042,
-0.011555501,
0.0012456534,
-0.044230446,
-0.03864219,
0.024374304,
-0.034272652,
-0.023185315,
-0.06836695,
0.0012317199,
... | XLM-V is compatible with the XLM-RoBERTa model architecture, only model weights from fairseq
library had to be converted.
The XLMTokenizer implementation is used to load the vocab and performs tokenization.
A XLM-V (base size) model is available under the facebook/xlm-v-base identifier.
XLM-V architecture is the sa... |
[
-0.0005471771,
0.019161258,
-0.01284882,
0.0047623212,
0.0094196685,
-0.03208006,
-0.009881554,
-0.019287227,
-0.026537431,
0.06662351,
0.029280754,
0.016487919,
0.00981857,
-0.015732106,
-0.013800585,
0.021610651,
-0.049239814,
-0.023066292,
-0.035663173,
-0.0052452018,
-0.0... | XLS-R is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.
XLS-R model was trained using connectionist temporal classification (CTC) so the model output has to be decoded using
[Wav2Vec2CTCTokenizer].
XLS-R's architecture is based on the Wav2Vec2 model, refer to Wav2Ve... |
[
0.033066947,
-0.018068103,
-0.020297661,
0.009012335,
0.011241892,
-0.01605571,
-0.019139448,
-0.037323374,
-0.034369934,
0.022787817,
0.033617094,
-0.0023091848,
0.006594568,
-0.04129025,
0.017677207,
-0.016562428,
-0.009120918,
-0.03500695,
-0.075515404,
-0.03463053,
0.0018... |
RemBERT
Overview
The RemBERT model was proposed in Rethinking Embedding Coupling in Pre-trained Language Models by Hyung Won Chung, Thibault Févry, Henry Tsai, Melvin Johnson, Sebastian Ruder.
The abstract from the paper is the following:
We re-evaluate the standard practice of sharing weights between input and output... |
[
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.0010070803,
-0.042884834,
0.022253677,
0.0008269948,
0.0003243288,
0.003437361,
-0.018379215,
0.013245903,
-0.019624079,
0.059473686,
0.05264792,
0.017316187,
0.02663168,
-0.002171517,
-0.041178394,
0.024281824,
-0.016658787,
-0.059697483,
-0.03342947,
-0.018644974,
0.00521... |
TFRemBertModel
[[autodoc]] TFRemBertModel
- call
TFRemBertForMaskedLM
[[autodoc]] TFRemBertForMaskedLM
- call
TFRemBertForCausalLM
[[autodoc]] TFRemBertForCausalLM
- call
TFRemBertForSequenceClassification
[[autodoc]] TFRemBertForSequenceClassification
- call
TFRemBertForMultipleChoice
[[autodoc]] TFR... |
[
-0.004176418,
-0.0012902333,
-0.01486791,
0.019856121,
-0.02640574,
0.007627404,
-0.014135568,
0.010411683,
0.00034695532,
0.048583243,
0.03169794,
0.0006714568,
0.0076412214,
-0.05250749,
-0.029625278,
0.0008782914,
-0.020243019,
-0.032748092,
-0.059305828,
-0.008518649,
0.0... | RemBertConfig
[[autodoc]] RemBertConfig
RemBertTokenizer
[[autodoc]] RemBertTokenizer
- build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
- save_vocabulary
RemBertTokenizerFast
[[autodoc]] RemBertTokenizerFast
- build_inputs_with_special_tokens
- g... |
[
0.0121600265,
-0.021484777,
-0.0030950604,
0.027747156,
-0.034739,
0.0002391403,
-0.000670109,
0.0041531273,
-0.027237909,
0.052879255,
0.039748903,
0.005694636,
0.018332943,
-0.017383263,
-0.05285173,
0.010384538,
-0.01264863,
-0.04492397,
-0.032289103,
-0.011306691,
0.03060... |
RemBertModel
[[autodoc]] RemBertModel
- forward
RemBertForCausalLM
[[autodoc]] RemBertForCausalLM
- forward
RemBertForMaskedLM
[[autodoc]] RemBertForMaskedLM
- forward
RemBertForSequenceClassification
[[autodoc]] RemBertForSequenceClassification
- forward
RemBertForMultipleChoice
[[autodoc]] RemBertFo... |
[
0.031795505,
-0.0153426835,
-0.02806658,
0.017079053,
0.024053002,
-0.013549383,
0.0024159746,
-0.036776897,
0.002115312,
0.037545454,
0.01191264,
0.010838083,
0.02052333,
-0.035439037,
-0.032706387,
0.019939795,
-0.018331518,
-0.04910228,
-0.0361222,
0.013428407,
0.029945275... |
SeamlessM4T
Overview
The SeamlessM4T model was proposed in SeamlessM4T — Massively Multilingual & Multimodal Machine Translation by the Seamless Communication team from Meta AI.
This is the version 1 release of the model. For the updated version 2 release, refer to the Seamless M4T v2 docs.
SeamlessM4T is a collection... |
[
-0.005355935,
0.02707776,
-0.030949675,
-0.00096717733,
-0.00020974207,
0.009199003,
0.0013958765,
-0.016551794,
0.020833978,
0.03341129,
-0.007275866,
0.022346845,
-0.008551546,
-0.045155242,
-0.027847014,
0.023103278,
-0.03833452,
-0.02226992,
-0.021244247,
-0.013070917,
-0... | Speech-to-speech translation (S2ST)
Speech-to-text translation (S2TT)
Text-to-speech translation (T2ST)
Text-to-text translation (T2TT)
Automatic speech recognition (ASR) |
[
0.014757112,
0.0038729236,
-0.016611751,
0.020830147,
-0.025499474,
-0.007927675,
0.013418862,
-0.02448124,
0.01665539,
0.026008591,
-0.000243876,
0.0021310172,
0.03773282,
-0.04989344,
-0.018110009,
0.010291431,
-0.024772165,
-0.06272318,
-0.026415884,
-0.024321232,
0.004414... | from transformers import AutoProcessor, SeamlessM4TModel
processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
model = SeamlessM4TModel.from_pretrained("facebook/hf-seamless-m4t-medium")
You can seamlessly use this model on text or on audio, to generated either translated text or translated audi... |
[
0.020972513,
-0.007658013,
-0.049806092,
0.0167374,
0.007817555,
-0.018028239,
-0.012930149,
-0.024641978,
0.023365643,
0.042235103,
-0.010399234,
0.012828623,
0.0039958004,
-0.065557234,
-0.00928244,
-0.0016579671,
-0.022364879,
-0.025062589,
-0.030370984,
-0.018854957,
0.01... |
[SeamlessM4TModel] can perform all the above tasks, but each task also has its own dedicated sub-model.
The abstract from the paper is the following:
What does it take to create the Babel Fish, a tool that can help individuals translate speech between any two languages? While recent breakthroughs in text-based models... |
[
0.005791617,
0.0090756705,
-0.014333005,
-0.004220828,
0.009866408,
-0.029207416,
-0.035020404,
-0.038639273,
-0.007551186,
0.050749667,
-0.0041068476,
0.0037969642,
0.021641983,
-0.054966934,
0.0048797755,
-0.0002457697,
-0.024035566,
-0.040234998,
-0.060808416,
-0.027967881,
... | let's load an audio sample from an Arabic speech corpus
from datasets import load_dataset
dataset = load_dataset("arabic_speech_corpus", split="test", streaming=True)
audio_sample = next(iter(dataset))["audio"]
now, process it
audio_inputs = processor(audios=audio_sample["array"], return_tensors="pt")
now, process some... |
[
-0.017071186,
-0.005290215,
-0.023668814,
0.020248877,
0.010416558,
-0.057910934,
-0.0030868493,
0.008029727,
-0.024253054,
0.04457318,
0.0016538602,
0.017569926,
0.032460902,
-0.057882432,
-0.017014187,
-0.023797061,
-0.011178919,
-0.056656957,
-0.054149,
-0.014021741,
-0.01... | from audio
output_tokens = model.generate(**audio_inputs, tgt_lang="fra", generate_speech=False)
translated_text_from_audio = processor.decode(output_tokens[0].tolist()[0], skip_special_tokens=True)
from text
output_tokens = model.generate(**text_inputs, tgt_lang="fra", generate_speech=False)
translated_text_from_text ... |
[
0.0055421153,
0.01369528,
-0.03348543,
-0.002083748,
-0.010233276,
-0.04040944,
-0.019448316,
-0.029616134,
0.018153701,
0.013251619,
0.012531581,
-0.022764858,
0.037732933,
-0.07162566,
0.0044293283,
0.008131345,
0.0021255685,
-0.027492383,
-0.049457196,
-0.00986962,
-0.0242... | Tips
1. Use dedicated models
[SeamlessM4TModel] is transformers top level model to generate speech and text, but you can also use dedicated models that perform the task without additional components, thus reducing the memory footprint.
For example, you can replace the audio-to-audio generation snippet with the model de... |
[
0.0011651926,
-0.011007956,
-0.049354356,
0.022442853,
0.007265109,
-0.04795968,
0.0015476603,
-0.0036859221,
-0.00085254735,
0.0345822,
-0.012552059,
0.032276724,
0.032504424,
-0.06791205,
-0.02093433,
-0.034212187,
-0.0077418596,
-0.04366181,
-0.0406163,
-0.0039456445,
-0.0... | With basically the same code, I've translated English text and Arabic speech to Russian speech samples.
Text
Similarly, you can generate translated text from audio files or from text with the same model. You only have to pass generate_speech=False to [SeamlessM4TModel.generate].
This time, let's translate to French.
th... |
[
0.008025281,
0.004628355,
-0.013804603,
0.014084473,
-0.013699652,
-0.045227043,
0.016288452,
-0.027091445,
0.022165729,
0.028770668,
0.00044997898,
-0.021102222,
0.046906263,
-0.051999904,
-0.013195885,
0.00563239,
-0.017170044,
-0.038734052,
-0.0074865306,
-0.019814817,
-0.... | from transformers import SeamlessM4TForSpeechToSpeech
model = SeamlessM4TForSpeechToSpeech.from_pretrained("facebook/hf-seamless-m4t-medium")
Or you can replace the text-to-text generation snippet with the model dedicated to the T2TT task, you only have to remove generate_speech=False.
thon
from transformers import S... |
[
0.0002843195,
0.0007134679,
-0.05344557,
0.02387077,
-0.010026615,
-0.04991026,
-0.00962555,
-0.016399086,
-0.00069211493,
0.026470263,
0.009194777,
0.010145449,
0.020157209,
-0.06422975,
-0.02740608,
-0.024999693,
-0.029277716,
-0.040255003,
-0.023261746,
0.00093860255,
-0.0... | Speech
[SeamlessM4TModel] can seamlessly generate text or speech with few or no changes. Let's target Russian voice translation:
thon
audio_array_from_text = model.generate(text_inputs, tgt_lang="rus")[0].cpu().numpy().squeeze()
audio_array_from_audio = model.generate(audio_inputs, tgt_lang="rus")[0].cpu().numpy().squ... |
[
0.008566994,
-0.003074913,
-0.027672404,
-0.00046703525,
0.007936428,
-0.033166297,
-0.020728936,
-0.021236287,
-0.01726445,
0.0461545,
-0.031020924,
0.030673027,
0.02091738,
-0.04311039,
-0.00086249766,
0.007675505,
-0.021352254,
-0.05693934,
-0.07247879,
-0.010951546,
-0.01... | Input text or speech is processed through its specific encoder.
A decoder creates text tokens in the desired language.
If speech generation is required, the second seq2seq model, following a standard encoder-decoder structure, generates unit tokens.
These unit tokens are then passed through the final vocoder to produce... |
[
0.019096281,
-0.005515386,
-0.037184376,
0.021068182,
-0.009948451,
-0.023677612,
-0.01725782,
-0.02235807,
0.02548642,
0.033981893,
0.019896902,
0.017598825,
0.03359641,
-0.05776329,
-0.031402115,
0.023351433,
-0.00547832,
-0.053522967,
-0.04347073,
-0.004544263,
0.038904227... |
This model was contributed by ylacombe. The original code can be found here.
SeamlessM4TModel
[[autodoc]] SeamlessM4TModel
- generate
SeamlessM4TForTextToSpeech
[[autodoc]] SeamlessM4TForTextToSpeech
- generate
SeamlessM4TForSpeechToSpeech
[[autodoc]] SeamlessM4TForSpeechToSpeech
- generate
SeamlessM4TFor... |
[
0.032680854,
-0.006825118,
0.014803175,
-0.024510643,
0.00513841,
-0.037406486,
-0.024368303,
-0.010839055,
0.0046509015,
0.064564615,
0.008220032,
-0.045775972,
0.036353182,
-0.022318633,
-0.0028218552,
0.009842688,
0.0101843,
0.0009714584,
-0.040424056,
0.0046686935,
0.0149... |
ImageGPT
Overview
The ImageGPT model was proposed in Generative Pretraining from Pixels by Mark
Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, Ilya Sutskever. ImageGPT (iGPT) is a GPT-2-like
model trained to predict the next pixel value, allowing for both unconditional and conditional image gener... |
[
0.056177728,
-0.0026822211,
0.010384412,
-0.022347655,
-0.005583326,
-0.0004566055,
-0.015802678,
0.01123124,
-0.023538956,
0.044838842,
0.04294424,
-0.025648851,
0.020625293,
-0.053823832,
-0.0137501955,
0.010743237,
0.013943961,
-0.018013043,
-0.03077288,
0.0014541405,
0.01... |
ImageGPT is almost exactly the same as GPT-2, with the exception that a different activation
function is used (namely "quick gelu"), and the layer normalization layers don't mean center the inputs. ImageGPT
also doesn't have tied input- and output embeddings.
As the time- and memory requirements of the attention ... |
[
-0.0005287837,
0.0010997169,
-0.04935315,
0.033290386,
0.006625124,
-0.038900092,
-0.035804022,
-0.04656362,
0.0050885854,
0.014545385,
0.009035305,
-0.008675119,
0.024002183,
-0.06743909,
-0.021151349,
0.006667273,
-0.0048893336,
-0.040555414,
-0.029673198,
0.00160551,
0.008... |
Feel free to try out [SeamlessM4TForSpeechToText] and [SeamlessM4TForTextToSpeech] as well.
2. Change the speaker identity
You have the possibility to change the speaker used for speech synthesis with the spkr_id argument. Some spkr_id works better than other for some languages!
3. Change the generation strategy
You ... |
[
0.026854219,
0.017455978,
-0.0035206573,
0.0029516807,
-0.027163565,
-0.022405522,
0.008573316,
0.03025703,
0.01654267,
0.10016933,
0.014627668,
-0.00047967114,
0.01494438,
-0.0319658,
-0.02840095,
0.006717237,
0.0051631397,
-0.057921443,
-0.054386053,
0.015349477,
0.03611988... | Summary of the approach. Taken from the original paper.
This model was contributed by nielsr, based on this issue. The original code can be found
here.
Usage tips |
[
0.051476207,
-0.020675523,
0.0036374836,
-0.02030347,
-0.023545647,
-0.034149162,
0.005982747,
0.034388337,
0.025950704,
0.06080411,
0.015546505,
-0.012968709,
0.047357045,
0.0072284606,
-0.04677239,
0.015732532,
0.030269178,
-0.03739134,
-0.029232744,
-0.021791682,
0.0011286... | Demo notebooks for ImageGPT can be found here.
[ImageGPTForImageClassification] is supported by this example script and notebook.
See also: Image classification task guide |
[
0.090500854,
-0.021086998,
0.025865922,
-0.03210839,
-0.019085824,
-0.040292297,
0.02785216,
0.0015232818,
-0.026299011,
0.03551337,
0.035334162,
-0.00086524646,
0.02925597,
-0.042024657,
-0.03177984,
0.04277136,
0.031212343,
-0.0329447,
-0.026702233,
-0.00875887,
0.015180548... |
| Model variant | Depths | Hidden sizes | Decoder hidden size | Params (M) | ImageNet-1k Top 1 |
|---|---|---|---|---|---|
| MiT-b0 | [2, 2, 2, 2] | [32, 64, 160, 256] | 256 | 3.7 | 70.5 |
| MiT-b1 | [2, 2, 2, 2] | [64, 128, 320, 512] | 256 | 14.0 | 78.7 |
| MiT-b2 | [3, 4, 6, 3] | [64, 128, 320, 512] | 768 | 25.4 | ... |
[
0.031950254,
-0.018497515,
-0.01795033,
-0.0046610804,
-0.027012244,
-0.024236282,
-0.0053183693,
0.022114273,
0.009088606,
0.058135048,
0.024756776,
-0.0051181796,
0.04855264,
-0.02653179,
-0.032217175,
0.036888264,
0.014947487,
-0.025317306,
-0.02597126,
-0.025277268,
0.010... |
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.
ImageGPTConfig
[[autodoc]] ImageGPTConfig
ImageGPTFeatureExtractor
[[autodoc]] ImageGPTFeat... |
[
-0.008216163,
-0.009095947,
-0.02821125,
-0.020547679,
0.016432326,
0.00080162124,
0.021056645,
-0.02032955,
-0.035104103,
0.05249619,
0.01313859,
0.018977156,
0.022539917,
-0.0009138664,
-0.033998918,
-0.0060094325,
-0.006616556,
-0.023237927,
-0.03847782,
0.010302924,
0.013... |
Nezha
Overview
The Nezha model was proposed in NEZHA: Neural Contextualized Representation for Chinese Language Understanding by Junqiu Wei et al.
The abstract from the paper is the following:
The pre-trained language models have achieved great successes in various natural language understanding (NLU) tasks
due to its... |
[
-0.00477097,
-0.00017785397,
-0.013128626,
0.014455023,
-0.05283934,
-0.024781974,
-0.022264525,
0.011477397,
-0.015551331,
0.06604917,
0.020220792,
0.048860144,
0.033809595,
-0.0050788834,
-0.050430167,
0.04065814,
-0.03324114,
-0.03984606,
-0.048941355,
-0.005451087,
0.0149... |
NezhaConfig
[[autodoc]] NezhaConfig
NezhaModel
[[autodoc]] NezhaModel
- forward
NezhaForPreTraining
[[autodoc]] NezhaForPreTraining
- forward
NezhaForMaskedLM
[[autodoc]] NezhaForMaskedLM
- forward
NezhaForNextSentencePrediction
[[autodoc]] NezhaForNextSentencePrediction
- forward
NezhaForSequenceClas... |
[
0.031179005,
-0.0070006154,
-0.022773381,
-0.019450227,
-0.018814918,
0.0005879662,
-0.0045968266,
-0.028808815,
-0.017141122,
0.0341112,
-0.0022755053,
0.01909592,
0.019523531,
-0.030030563,
-0.023995128,
-0.003231523,
-0.053708035,
-0.035675038,
-0.052535158,
-0.04036655,
-... | Text classification task guide
Token classification task guide
Question answering task guide
Masked language modeling task guide
Multiple choice task guide |
[
0.017288653,
0.025022289,
-0.031628404,
-0.016594794,
0.025600504,
-0.012388273,
-0.022174576,
-0.03480859,
-0.0077047255,
0.04793409,
0.02746525,
-0.038595904,
0.038566995,
-0.060828302,
0.01026333,
0.0037475612,
0.0065193833,
-0.031194743,
-0.049610917,
-0.016710436,
0.0119... |
Audio Spectrogram Transformer
Overview
The Audio Spectrogram Transformer model was proposed in AST: Audio Spectrogram Transformer by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a Vision Transformer to audio, by turning audio into an image (spectrogram). The model obtains state-of-the... |
[
0.030946473,
0.01868414,
-0.012393813,
-0.022199526,
0.018531898,
-0.035347626,
-0.02272545,
-0.0090445075,
-0.010906002,
0.043015044,
0.025105948,
-0.033077847,
0.032579605,
-0.0693666,
0.011729488,
0.0035309566,
-0.0035465267,
-0.06493777,
-0.061837584,
-0.00095496717,
0.05... | Audio Spectrogram Transformer architecture. Taken from the original paper.
This model was contributed by nielsr.
The original code can be found here.
Usage tips |
[
0.00920086,
0.035045493,
0.003661205,
-0.011426645,
0.018798675,
-0.013064086,
-0.042332463,
-0.01990448,
-0.036491547,
0.022980884,
0.02248469,
-0.026369182,
0.04270106,
-0.056339316,
0.009300099,
0.018798675,
-0.009767939,
-0.043012958,
-0.06459032,
-0.0039872755,
0.0071416... |
When fine-tuning the Audio Spectrogram Transformer (AST) on your own dataset, it's recommended to take care of the input normalization (to make
sure the input has mean of 0 and std of 0.5). [ASTFeatureExtractor] takes care of this. Note that it uses the AudioSet
mean and std by default. You can check ast/src/get_norm... |
[
0.023090316,
0.017944722,
-0.018924834,
-0.023810988,
-0.004302409,
-0.025482945,
-0.0035330923,
-0.01417561,
-0.010190296,
0.040299952,
0.01739701,
-0.019890536,
0.039348666,
-0.06901151,
0.003221402,
0.018463606,
0.014644046,
-0.061401214,
-0.04283672,
-0.024906408,
-0.0137... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with the Audio Spectrogram Transformer.
A notebook illustrating inference with AST for audio classification can be found here.
[ASTForAudioClassification] is supported by this example script and notebook.
See al... |
[
0.015717667,
-0.00212871,
-0.03291963,
0.006911267,
-0.029076356,
-0.031011246,
-0.022966877,
0.015399601,
0.014975516,
0.046198804,
0.019998278,
-0.014445409,
0.050598692,
-0.050360143,
0.0004953185,
0.04031462,
0.024901766,
-0.030242592,
-0.047550578,
-0.038512256,
-0.00636... | 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.
ASTConfig
[[autodoc]] ASTConfig
ASTFeatureExtractor
[[autodoc]] ASTFeatureExtractor
- cal... |
[
0.015456901,
0.006398487,
-0.05048975,
-0.043061502,
0.023764811,
-0.01817966,
0.0062274416,
-0.025454318,
-0.007595803,
0.062274415,
0.009564568,
-0.013390396,
0.030159807,
-0.018835917,
-0.003366798,
0.023932366,
0.0010995764,
-0.0242954,
0.00093900325,
-0.010918967,
0.0005... |
Mask2Former
Overview
The Mask2Former model was proposed in Masked-attention Mask Transformer for Universal Image Segmentation by Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexander Kirillov, Rohit Girdhar. Mask2Former is a unified framework for panoptic, instance and semantic segmentation and features significan... |
[
0.023116188,
0.0075027435,
-0.04275044,
0.00137913,
0.014273175,
-0.036090545,
0.00050173735,
-0.0091884425,
-0.0020553095,
0.06963872,
0.021679198,
-0.0050916406,
0.037085384,
-0.045652054,
0.0019741335,
0.041617427,
0.0013929472,
-0.021637747,
-0.012870729,
0.0020294024,
0.... | Mask2Former architecture. Taken from the original paper.
This model was contributed by Shivalika Singh and Alara Dirik. The original code can be found here.
Usage tips |
[
0.030853555,
-0.00023341544,
-0.033838484,
-0.010049722,
0.0019614743,
-0.03233207,
0.038720373,
0.013215978,
0.0011786281,
0.05473298,
-0.0034766044,
0.02238696,
0.039250407,
-0.056211494,
0.013460073,
0.055179324,
0.020266823,
-0.0393341,
-0.0029134431,
-0.011507316,
-0.023... | Resources
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Mask2Former.
Demo notebooks regarding inference + fine-tuning Mask2Former on custom data can be found here. |
[
0.010955947,
-0.010266568,
-0.026744965,
-0.023038622,
-0.0051073395,
-0.045662135,
-0.023409257,
-0.01610035,
0.031696636,
0.041599985,
-0.0005378829,
-0.012571912,
0.005470561,
-0.033327427,
0.0014325012,
0.059360776,
-0.0023127575,
-0.039287228,
-0.03187454,
-0.012646039,
... |
Mask2Former uses the same preprocessing and postprocessing steps as MaskFormer. Use [Mask2FormerImageProcessor] or [AutoImageProcessor] to prepare images and optional targets for the model.
To get the final segmentation, depending on the task, you can call [~Mask2FormerImageProcessor.post_process_semantic_segmentatio... |
[
0.025097862,
-0.0044731833,
-0.041469514,
-0.00019920427,
-0.0131760435,
-0.029674452,
-0.00617773,
-0.016665194,
0.0072117993,
0.07167768,
0.011294705,
0.009940408,
0.039441403,
-0.045125447,
-0.011901803,
0.0619641,
0.021135041,
-0.047794014,
-0.025498146,
-0.03631918,
-0.0... |
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.
Mask2FormerConfig
[[autodoc]] Mask2FormerConfig
MaskFormer specific outputs
[[autodoc]] m... |
[
0.0038985263,
0.030992057,
-0.020259727,
-0.0015569585,
-0.0065255654,
0.019236933,
-0.046347976,
-0.017625682,
0.025639903,
0.06175994,
-0.010080826,
0.0037233902,
0.02030176,
-0.05071937,
-0.014459224,
0.011874218,
-0.009352259,
-0.06669177,
-0.032869514,
-0.008616689,
0.02... | Usage tips
The model can also be used for time series classification and time series regression. See the respective [PatchTSMixerForTimeSeriesClassification] and [PatchTSMixerForRegression] classes.
Resources
A blog post explaining PatchTSMixer in depth can be found here. The blog can also be opened in Google Colab. |
[
-0.011645212,
-0.0022576426,
-0.0046326085,
-0.011920084,
-0.026320726,
-0.016840974,
-0.027782243,
-0.0102239195,
0.0060337884,
0.08313219,
0.0043208627,
0.025341911,
0.026307316,
-0.023330647,
-0.024108337,
0.042102434,
-0.048028953,
-0.052534185,
-0.06409224,
-0.0064293365,
... | PatchTSMixerConfig
[[autodoc]] PatchTSMixerConfig
PatchTSMixerModel
[[autodoc]] PatchTSMixerModel
- forward
PatchTSMixerForPrediction
[[autodoc]] PatchTSMixerForPrediction
- forward
PatchTSMixerForTimeSeriesClassification
[[autodoc]] PatchTSMixerForTimeSeriesClassification
- forward
PatchTSMixerForPretraini... |
[
0.023026526,
-0.015396079,
0.024813974,
0.007547834,
0.0076980395,
-0.04229791,
0.0024070456,
-0.027052037,
-0.008073553,
0.03803207,
-0.0025966803,
-0.024768911,
0.020818504,
-0.047374863,
-0.031963762,
-0.014847829,
-0.009800918,
-0.0067592543,
-0.07492258,
-0.0105219055,
0... |
GPTBigCode
Overview
The GPTBigCode model was proposed in SantaCoder: don't reach for the stars! by BigCode. The listed authors are: Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar Umapathi, Caroly... |
[
0.016404195,
0.025815483,
-0.043938767,
-0.038315304,
-0.011946217,
0.0138474135,
-0.012834899,
0.0153406905,
0.025072487,
0.055972397,
-0.015734041,
-0.0091272015,
0.03738292,
-0.056263767,
0.011800531,
0.06118794,
0.0005262891,
-0.034469206,
-0.0221005,
-0.020949585,
0.0345... | pip install -U flash-attn --no-build-isolation
Make also sure that you have a hardware that is compatible with Flash-Attention 2. Read more about it in the official documentation of flash-attn repository. Make also sure to load your model in half-precision (e.g. `torch.float16``)
To load and run a model using Flash Att... |
[
0.018236412,
0.052145418,
-0.01736732,
-0.015238049,
-0.0042078453,
-0.02191556,
-0.038153064,
-0.046264574,
-0.008640206,
0.067731105,
-0.0032699523,
-0.00568892,
-0.014825232,
-0.043599363,
-0.0022143696,
-0.0012121999,
-0.020698834,
-0.051652934,
-0.039311852,
-0.028955191,
... |
PatchTSMixer
Overview
The PatchTSMixer model was proposed in TSMixer: Lightweight MLP-Mixer Model for Multivariate Time Series Forecasting by Vijay Ekambaram, Arindam Jati, Nam Nguyen, Phanwadee Sinthong and Jayant Kalagnanam.
PatchTSMixer is a lightweight time-series modeling approach based on the MLP-Mixer architect... |
[
0.008412376,
-0.005856718,
-0.0005643746,
-0.004933841,
-0.0076456787,
0.003428842,
-0.001623908,
-0.0020250045,
0.0028183237,
0.031491395,
0.019607581,
-0.016498197,
0.015319753,
-0.060995053,
-0.008525961,
0.038278088,
-0.017676638,
-0.045575913,
-0.044014122,
-0.006296859,
... |
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained("bigcode/gpt_bigcode-santacoder", torch_dtype=torch.float16, attn_implementation="flash_attention_2")
tokenizer = AutoTokenizer.from_pretrained("bi... |
[
0.000008136573,
-0.00050670217,
-0.019948712,
-0.050201684,
-0.01162388,
-0.037988186,
-0.011041282,
-0.022433527,
-0.0017346324,
0.080805615,
0.003888665,
-0.0064542014,
0.005032803,
-0.070866354,
0.023374105,
0.03464702,
-0.027585655,
-0.032990478,
-0.036472026,
0.003195514,
... | Expected speedups
Below is a expected speedup diagram that compares pure inference time between the native implementation in transformers using bigcode/starcoder checkpoint and the Flash Attention 2 version of the model using two different sequence lengths. |
[
-0.023286607,
-0.01348758,
0.01873507,
-0.0023436237,
-0.030677633,
0.013821638,
0.0034397505,
0.008901246,
-0.012026078,
0.07494028,
0.018623717,
0.0005132658,
0.024622837,
-0.038500153,
-0.018846422,
0.023300527,
-0.034407943,
-0.010063489,
-0.062134735,
-0.009242264,
0.033... | GPTBigCodeConfig
[[autodoc]] GPTBigCodeConfig
GPTBigCodeModel
[[autodoc]] GPTBigCodeModel
- forward
GPTBigCodeForCausalLM
[[autodoc]] GPTBigCodeForCausalLM
- forward
GPTBigCodeForSequenceClassification
[[autodoc]] GPTBigCodeForSequenceClassification
- forward
GPTBigCodeForTokenClassification
[[autodoc]] GPT... |
[
0.018769726,
-0.008261272,
-0.014405008,
0.004011795,
0.025727345,
-0.003698486,
0.009687368,
-0.032670557,
-0.0014882174,
0.05511356,
0.03532108,
0.010191543,
0.0025208765,
-0.042782873,
0.012244257,
0.0019284704,
0.0011749085,
-0.04091022,
-0.040017113,
-0.01771816,
0.01858... |
Nyströmformer
Overview
The Nyströmformer model was proposed in Nyströmformer: A Nyström-Based Algorithm for Approximating Self-Attention by Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn
Fung, Yin Li, and Vikas Singh.
The abstract from the paper is the following:
Transformers have emerged as a... |
[
0.03112995,
-0.0069822473,
-0.022773245,
-0.019450111,
-0.018765936,
0.0005501651,
-0.0046090162,
-0.028833078,
-0.017067716,
0.034086563,
-0.0022846549,
0.019059153,
0.01954785,
-0.030005949,
-0.023994986,
-0.003213178,
-0.053707715,
-0.035674825,
-0.052485976,
-0.04041518,
... | Text classification task guide
Token classification task guide
Question answering task guide
Masked language modeling task guide
Multiple choice task guide |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.