vector
listlengths
1.02k
1.02k
text
stringlengths
2
11.8k
[ -0.0049222764, -0.026430408, -0.0080994135, 0.010224543, -0.022081634, 0.011751539, 0.011582655, 0.011857091, 0.0073253606, 0.07374618, 0.040954463, 0.049736455, 0.03853379, -0.022081634, -0.012814104, 0.07211363, -0.016846217, -0.058490295, -0.056013323, -0.014355173, 0.0083...
NystromformerConfig [[autodoc]] NystromformerConfig NystromformerModel [[autodoc]] NystromformerModel - forward NystromformerForMaskedLM [[autodoc]] NystromformerForMaskedLM - forward NystromformerForSequenceClassification [[autodoc]] NystromformerForSequenceClassification - forward NystromformerForMultip...
[ 0.061144657, 0.011784324, -0.03616338, 0.0000040768546, 0.00942746, 0.0030074192, -0.002498128, 0.010475781, 0.024163442, 0.06988811, 0.031464517, 0.001282521, 0.00007870544, -0.052847303, 0.002423779, 0.04621537, 0.0081709605, -0.026483132, -0.008394008, -0.014178364, 0.0252...
Overview The GLPN model was proposed in Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth by Doyeon Kim, Woonghyun Ga, Pyungwhan Ahn, Donggyu Joo, Sehwan Chun, Junmo Kim. GLPN combines SegFormer's hierarchical mix-Transformer with a lightweight decoder for monocular depth estimation. T...
[ 0.02337364, -0.0034107454, -0.017225698, 0.06041892, -0.019203357, 0.00046888794, 0.0018755518, 0.03637173, 0.05075992, 0.071596995, 0.026497766, -0.015033076, 0.021023376, -0.025594922, -0.035597865, 0.06580733, 0.012410528, -0.014424014, 0.008462375, -0.012926439, 0.0276442...
GLPN This is a recently introduced model so the API hasn't been tested extensively. There may be some bugs or slight breaking changes to fix it in the future. If you see something strange, file a Github Issue.
[ 0.051537383, 0.00005195391, -0.026313605, -0.00268872, -0.010948467, -0.016361756, 0.0053881947, 0.04003683, 0.014547767, 0.058449186, 0.007209354, -0.011715649, 0.0065282118, -0.036021676, -0.0005816597, 0.044654258, 0.0076216245, -0.040610425, -0.022456188, -0.00036163282, ...
Summary of the approach. Taken from the original paper. This model was contributed by nielsr. The original code can be found here. Resources A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with GLPN. Demo notebooks for [GLPNForDepthEstimation] can be found here. Monoc...
[ 0.03049326, -0.010643347, -0.036882058, -0.004160391, -0.016850805, 0.009611096, -0.03303204, 0.04530746, 0.0136843035, 0.067068435, 0.010720069, 0.0025108815, 0.021649377, -0.020589229, 0.0010313794, 0.07906487, -0.009192616, -0.051640462, -0.01839918, -0.012163825, 0.007316...
Demo notebooks for [GLPNForDepthEstimation] can be found here. Monocular depth estimation task guide GLPNConfig [[autodoc]] GLPNConfig GLPNFeatureExtractor [[autodoc]] GLPNFeatureExtractor - call GLPNImageProcessor [[autodoc]] GLPNImageProcessor - preprocess GLPNModel [[autodoc]] GLPNModel - forward GLPNFo...
[ 0.018471716, -0.000060879072, -0.0009572387, 0.05273787, -0.057224926, -0.025516395, -0.015824353, -0.0017377996, 0.0296744, 0.024738638, 0.02277929, 0.013491083, 0.028762031, -0.0755022, -0.04666539, 0.038409203, -0.007859827, -0.033024736, -0.018426845, -0.037870757, 0.0214...
The original checkpoints can be converted using the conversion script src/transformers/models/gemma/convert_gemma_weights_to_hf.py
[ 0.029044373, 0.0053425115, -0.017724741, 0.0079473555, -0.033885103, -0.004678387, 0.0059844987, -0.0031472116, 0.006692898, 0.037722263, 0.026092708, 0.038253564, -0.0066596917, -0.024926802, -0.012780705, 0.036748216, 0.0023428833, -0.022078447, -0.045809824, -0.052037835, ...
Gemma Overview The Gemma model was proposed in Gemma: Open Models Based on Gemini Technology and Research by Gemma Team, Google. Gemma models are trained on 6T tokens, and released with 2 versions, 2b and 7b. The abstract from the paper is the following: This work introduces Gemma, a new family of open language models...
[ 0.030451596, 0.0032533095, 0.00592457, 0.004957057, -0.018163027, -0.011787466, -0.030174062, 0.013460376, -0.0054851416, 0.034599178, 0.050881147, 0.0128205065, 0.0032648735, -0.021339245, -0.030960407, 0.023929557, 0.018193865, -0.032533098, -0.033273187, -0.027799608, 0.04...
This model was contributed by Arthur Zucker, Younes Belkada, Sanchit Gandhi, Pedro Cuenca. GemmaConfig [[autodoc]] GemmaConfig GemmaTokenizer [[autodoc]] GemmaTokenizer GemmaTokenizerFast [[autodoc]] GemmaTokenizerFast GemmaModel [[autodoc]] GemmaModel - forward GemmaForCausalLM [[autodoc]] GemmaForCausalLM -...
[ 0.029325696, 0.018269174, -0.031182846, 0.01965124, 0.029973539, -0.009429716, -0.028245958, -0.046097632, -0.013784661, 0.033054393, 0.03311198, -0.011510012, 0.03204664, -0.075552896, -0.02431571, 0.005729812, -0.03207543, -0.019636843, -0.048487455, -0.025107518, 0.0077669...
WavLM Overview The WavLM model was proposed in WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing by Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin Qian, Yao Qian, Jian Wu...
[ 0.022921488, 0.034952104, -0.038272835, -0.0044921334, 0.017236847, -0.007211334, -0.025215045, -0.030252425, -0.012304998, 0.056480575, 0.02749453, -0.018798716, 0.023456182, -0.055073485, -0.026242219, 0.030364992, -0.022527503, -0.053019132, -0.025693456, -0.035965208, -0....
WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use [Wav2Vec2Processor] for the feature extraction. WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded using [Wav2Vec2CTCTokenizer]. Wa...
[ 0.015653063, 0.012447911, -0.044289358, 0.016384894, -0.009703544, -0.014460448, -0.016520418, -0.0037709652, -0.012908694, 0.04480435, 0.016208712, -0.002895139, 0.021954944, -0.05420974, 0.011627989, 0.030655608, -0.016777914, -0.0205997, -0.051499255, -0.03556159, 0.001580...
Resources Audio classification task guide Automatic speech recognition task guide WavLMConfig [[autodoc]] WavLMConfig WavLMModel [[autodoc]] WavLMModel - forward WavLMForCTC [[autodoc]] WavLMForCTC - forward WavLMForSequenceClassification [[autodoc]] WavLMForSequenceClassification - forward WavLMForAudioF...
[ -0.002344034, 0.013970442, -0.038341183, -0.0077028563, 0.0027839912, -0.0014127312, -0.037475694, -0.016819345, -0.009801668, 0.039264373, 0.02095927, -0.013285263, 0.024781847, -0.05585292, -0.02374326, 0.01187163, -0.0370141, -0.03026328, -0.047746167, -0.053169902, 0.0199...
UniSpeechSat is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use [Wav2Vec2Processor] for the feature extraction. UniSpeechSat model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded using [Wav2Vec2CTC...
[ 0.0042824303, 0.0067021633, -0.048025668, 0.004630134, 0.011403257, -0.0063757477, -0.041270282, -0.04081614, -0.0068050553, 0.027816284, 0.04109998, -0.020706102, 0.023147123, -0.05435529, -0.022437524, 0.0044598305, -0.023970257, -0.017810937, -0.02198338, -0.045584645, 0.0...
UniSpeech-SAT Overview The UniSpeech-SAT model was proposed in UniSpeech-SAT: Universal Speech Representation Learning with Speaker Aware Pre-Training by Sanyuan Chen, Yu Wu, Chengyi Wang, Zhengyang Chen, Zhuo Chen, Shujie Liu, Jian Wu, Yao Qian, Furu Wei, Jinyu Li, Xiangzhan Yu . The abstract from the paper is the fo...
[ 0.024657777, 0.06125618, -0.034294296, 0.0089172805, -0.02230275, -0.016663413, -0.048526302, -0.028744068, -0.0058334675, 0.02848947, 0.014104707, -0.013391834, 0.017516315, -0.056622505, 0.008567209, 0.013111777, -0.03831694, -0.022519158, -0.0489082, -0.07322227, 0.0073960...
Resources Audio classification task guide Automatic speech recognition task guide
[ -0.0077273855, -0.041721072, -0.01655771, 0.049264636, -0.018232545, -0.03850757, -0.026048437, 0.01274508, -0.011594482, 0.0318627, -0.0151415905, -0.02957512, 0.017755967, 0.007271231, 0.013174, -0.015413921, -0.0024850182, -0.012486366, -0.027873054, 0.0037785894, 0.030446...
DPR
[ -0.017041111, 0.000032854303, -0.020899735, -0.0027892631, -0.020419123, -0.010642112, -0.026543487, 0.009701487, -0.010346879, 0.038476385, 0.015228519, 0.02282218, 0.019787462, -0.04883013, -0.008802056, 0.017398138, -0.023920722, -0.027216343, -0.083324306, -0.03240695, 0....
UniSpeechSatConfig [[autodoc]] UniSpeechSatConfig UniSpeechSat specific outputs [[autodoc]] models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForPreTrainingOutput UniSpeechSatModel [[autodoc]] UniSpeechSatModel - forward UniSpeechSatForCTC [[autodoc]] UniSpeechSatForCTC - forward UniSpeechSatForSequence...
[ 0.041989915, -0.0088903485, -0.011746656, 0.0412594, 0.0041894945, 0.007049455, -0.0049967123, -0.027978666, -0.022952734, 0.07334355, -0.016348891, 0.011417925, -0.0010181532, -0.022193, -0.02330338, -0.03190883, -0.017064795, 0.009343267, -0.03190883, 0.025772516, 0.0300387...
Overview Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research. It was introduced in Dense Passage Retrieval for Open-Domain Question Answering by Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, Wen-tau Yih. The abstra...
[ 0.01609896, -0.023863826, -0.039466534, -0.005447812, 0.0060462323, 0.016025983, -0.03219792, -0.0018554672, -0.01836128, 0.06322819, -0.02322162, -0.004181643, 0.018769957, 0.009144151, -0.011654596, -0.028563613, -0.018448854, -0.017748265, -0.06696467, 0.0023352979, 0.0296...
DPR consists in three models: Question encoder: encode questions as vectors Context encoder: encode contexts as vectors Reader: extract the answer of the questions inside retrieved contexts, along with a relevance score (high if the inferred span actually answers the question).
[ -0.007951831, -0.04689232, -0.0363704, 0.019929906, -0.0064822524, 0.0021456524, -0.013132265, 0.015353409, -0.02145988, 0.06962717, 0.004727481, 0.017930206, 0.030331036, -0.0155413, -0.013729491, -0.0016834731, -0.0010375965, -0.049066488, -0.055079013, -0.01799731, 0.00268...
DPRContextEncoder [[autodoc]] DPRContextEncoder - forward DPRQuestionEncoder [[autodoc]] DPRQuestionEncoder - forward DPRReader [[autodoc]] DPRReader - forward TFDPRContextEncoder [[autodoc]] TFDPRContextEncoder - call TFDPRQuestionEncoder [[autodoc]] TFDPRQuestionEncoder - call TFDPRReader [[autod...
[ 0.03703784, -0.020115122, -0.03963906, -0.0018317546, -0.0167158, -0.0041050515, -0.013257358, -0.033668075, -0.023810038, 0.062251944, 0.019494377, -0.0066988827, -0.0051285434, -0.020898445, 0.002089475, -0.0029078987, -0.02459336, -0.016612342, -0.05447784, -0.0157699, 0.0...
REALM Overview The REALM model was proposed in REALM: Retrieval-Augmented Language Model Pre-Training by Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat and Ming-Wei Chang. It's a retrieval-augmented language model that firstly retrieves documents from a textual knowledge corpus and then utilizes retrieved documen...
[ -0.017476946, -0.036769327, -0.01450993, 0.03135012, 0.0014157682, -0.021798765, -0.012829975, 0.00927362, -0.017029861, 0.059231944, 0.0025267059, 0.0038340897, 0.024305148, -0.040887926, 0.0054937224, -0.0011236389, -0.014658958, -0.031187544, -0.07830756, -0.009801993, 0.0...
DPRConfig [[autodoc]] DPRConfig DPRContextEncoderTokenizer [[autodoc]] DPRContextEncoderTokenizer DPRContextEncoderTokenizerFast [[autodoc]] DPRContextEncoderTokenizerFast DPRQuestionEncoderTokenizer [[autodoc]] DPRQuestionEncoderTokenizer DPRQuestionEncoderTokenizerFast [[autodoc]] DPRQuestionEncoderTokenizerFast DP...
[ 0.03153233, 0.0014589024, 0.005575762, -0.032183513, -0.00096816645, 0.009354507, -0.0038851884, -0.027124314, 0.017056009, 0.051693983, 0.021827184, -0.0063239974, -0.028777318, -0.044030048, -0.011420764, 0.016342212, -0.015077411, -0.033460833, -0.043253638, -0.032509103, ...
Step-by-step Optical Character Recognition (OCR)
[ 0.030212885, -0.03968741, 0.025416955, 0.012209819, 0.0037051116, -0.012906475, -0.017086413, -0.0050525917, 0.0015445604, 0.020665027, -0.014211789, -0.01391846, 0.008579873, -0.024184974, 0.00044388924, 0.016573086, 0.009371861, -0.038866088, -0.024008976, -0.023832979, 0.0...
MGP-STR architecture. Taken from the original paper. MGP-STR is trained on two synthetic datasets MJSynth (MJ) and SynthText (ST) without fine-tuning on other datasets. It achieves state-of-the-art results on six standard Latin scene text benchmarks, including 3 regular text datasets (IC13, SVT, IIIT) and 3 irregul...
[ 0.03559905, -0.019015102, 0.027032122, 0.0006796922, 0.004037453, -0.027741209, -0.0030932098, -0.010361349, -0.0034658422, 0.030649912, 0.0033518819, -0.040316645, 0.039564144, -0.032357506, 0.029723758, 0.014131085, 0.0041532223, -0.030997219, -0.013928489, -0.03490443, 0.0...
from transformers import MgpstrProcessor, MgpstrForSceneTextRecognition import requests from PIL import Image processor = MgpstrProcessor.from_pretrained('alibaba-damo/mgp-str-base') model = MgpstrForSceneTextRecognition.from_pretrained('alibaba-damo/mgp-str-base') load image from the IIIT-5k dataset url = "https://i...
[ 0.002352373, -0.051769696, -0.029130949, 0.034279935, -0.011284395, 0.0035731585, 0.015698811, 0.013180285, -0.0154749425, 0.042031396, 0.0046977503, 0.005960511, 0.014425556, -0.042730987, -0.00338252, 0.062627345, -0.016762188, -0.05000673, -0.04429807, -0.021169608, 0.0154...
MgpstrConfig [[autodoc]] MgpstrConfig MgpstrTokenizer [[autodoc]] MgpstrTokenizer - save_vocabulary MgpstrProcessor [[autodoc]] MgpstrProcessor - call - batch_decode MgpstrModel [[autodoc]] MgpstrModel - forward MgpstrForSceneTextRecognition [[autodoc]] MgpstrForSceneTextRecognition - forward
[ 0.03884684, -0.027031178, 0.01666389, 0.031711705, -0.015238388, -0.002698544, 0.038663886, -0.010252942, -0.002338357, 0.05409285, 0.0003487525, -0.01785308, 0.032656956, -0.04113374, 0.0047186404, 0.010999997, -0.0059611904, -0.018798333, -0.0008442479, -0.0066510728, 0.025...
MGP-STR Overview The MGP-STR model was proposed in Multi-Granularity Prediction for Scene Text Recognition by Peng Wang, Cheng Da, and Cong Yao. MGP-STR is a conceptually simple yet powerful vision Scene Text Recognition (STR) model, which is built upon the Vision Transformer (ViT). To integrate linguistic knowledge, ...
[ 0.030026449, 0.026899867, 0.0060348655, -0.005200406, -0.038364, -0.033716377, 0.019505925, 0.0047109975, -0.008823439, 0.028237818, 0.010471231, 0.025716836, 0.014041449, -0.014562546, -0.030308122, 0.027167458, -0.028308237, -0.060165565, -0.0066017346, 0.014661131, -0.0118...
Implementation Notes The original implementation of MEGA had an inconsistent expectation of attention masks for padding and causal self-attention between the softmax attention and Laplace/squared ReLU method. This implementation addresses that inconsistency. The original implementation did not include token type embed...
[ 0.069270685, -0.0035225872, 0.0077181053, 0.02116299, -0.026203105, -0.008954101, 0.013898083, 0.016273942, 0.009887964, 0.06421684, 0.02404698, 0.023113117, -0.029856158, -0.055427533, -0.030515356, -0.0107874945, 0.000275524, -0.034223344, -0.053559806, 0.020847125, -0.0040...
MEGA can perform quite well with relatively few parameters. See Appendix D in the MEGA paper for examples of architectural specs which perform well in various settings. If using MEGA as a decoder, be sure to set bidirectional=False to avoid errors with default bidirectional. Mega-chunk is a variant of mega that reduce...
[ 0.04530368, 0.00035462138, -0.009854356, 0.011838405, 0.016370237, -0.01692665, 0.022490773, -0.034263287, -0.011765193, 0.03640108, 0.012350891, 0.0015456916, -0.0037228381, -0.038509592, -0.016458092, -0.015008491, 0.0046526324, -0.048700724, -0.041584503, -0.0136101395, 0....
MEGA Overview The MEGA model was proposed in Mega: Moving Average Equipped Gated Attention by Xuezhe Ma, Chunting Zhou, Xiang Kong, Junxian He, Liangke Gui, Graham Neubig, Jonathan May, and Luke Zettlemoyer. MEGA proposes a new approach to self-attention with each encoder layer having a multi-headed exponential moving...
[ 0.017798545, -0.024497775, 0.00417876, 0.024828112, -0.035623517, -0.0063854097, 0.0035775474, 0.020414812, 0.0057908036, 0.056976486, 0.053725973, 0.028620379, 0.025079168, -0.0326637, -0.050528314, 0.03757911, -0.002690593, -0.054043096, -0.030285275, -0.02139261, 0.0002646...
MegaConfig [[autodoc]] MegaConfig MegaModel [[autodoc]] MegaModel - forward MegaForCausalLM [[autodoc]] MegaForCausalLM - forward MegaForMaskedLM [[autodoc]] MegaForMaskedLM - forward MegaForSequenceClassification [[autodoc]] MegaForSequenceClassification - forward MegaForMultipleChoice [[autodoc]] Mega...
[ 0.03071308, -0.011167709, 0.032397635, 0.007227049, -0.031465113, -0.05384565, 0.032187067, -0.01845492, -0.0046438114, 0.028637465, 0.013506535, 0.013326047, 0.040068384, -0.053935897, -0.01273194, 0.011152668, 0.007268411, -0.013777267, -0.04939361, -0.026772419, 0.00053300...
CodeGen model checkpoints are available on different pre-training data with variable sizes. The format is: Salesforce/codegen-{size}-{data}, where size: 350M, 2B, 6B, 16B data: nl: Pre-trained on the Pile multi: Initialized with nl, then further pre-trained on multiple programming languages data mono: Initialized with...
[ 0.015207449, -0.0077524004, 0.0023788188, 0.0013168461, 0.00007511244, -0.06258559, -0.0075824847, -0.006577151, -0.011688779, 0.04279042, 0.008708176, -0.010704684, 0.033869848, -0.041317817, -0.0041169142, -0.013635729, -0.0063612163, -0.027398895, -0.07527262, 0.007964795, ...
CodeGen Overview The CodeGen model was proposed in A Conversational Paradigm for Program Synthesis by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. CodeGen is an autoregressive language model for program synthesis trained sequentially on The Pile, BigQuery...
[ 0.040952772, -0.017201323, -0.012209027, 0.045271218, -0.038083468, -0.041068703, -0.013259655, -0.026446853, 0.029330647, 0.0231573, 0.020592317, 0.016505735, 0.015259472, -0.040691927, -0.012397415, -0.013592958, -0.018447585, -0.015766673, -0.024505002, -0.018012844, 0.034...
For example, Salesforce/codegen-350M-mono offers a 350 million-parameter checkpoint pre-trained sequentially on the Pile, multiple programming languages, and Python. Usage example thon
[ 0.0024002434, 0.0027660925, -0.015536619, 0.0049235765, -0.004684236, -0.03350767, -0.0022993786, -0.0023882764, -0.029486751, 0.038704783, -0.0035183057, -0.01609736, 0.009279574, -0.0508496, -0.0006214306, -0.004554308, -0.011132753, -0.02591716, -0.0751666, -0.010585689, 0...
hello_world() Resources Causal language modeling task guide CodeGenConfig [[autodoc]] CodeGenConfig - all CodeGenTokenizer [[autodoc]] CodeGenTokenizer - save_vocabulary CodeGenTokenizerFast [[autodoc]] CodeGenTokenizerFast CodeGenModel [[autodoc]] CodeGenModel - forward CodeGenForCausalLM [[autodoc]] Co...
[ 0.017647509, 0.004699296, -0.0008941416, 0.015420013, -0.029690351, -0.018193604, -0.016828366, 0.0041424218, -0.016957704, 0.031242412, 0.0034292643, -0.0053639514, -0.007868087, -0.039290138, -0.012517084, 0.021872563, -0.010275219, -0.032248378, -0.04271042, -0.008320771, ...
Usage example thon from transformers import AutoModelForCausalLM, AutoTokenizer checkpoint = "Salesforce/codegen-350M-mono" model = AutoModelForCausalLM.from_pretrained(checkpoint) tokenizer = AutoTokenizer.from_pretrained(checkpoint) text = "def hello_world():" completion = model.generate(**tokenizer(text, return_ten...
[ 0.021291776, -0.025812265, -0.035762694, -0.008733372, 0.021131285, 0.01748012, -0.020395702, 0.01590196, -0.026801959, 0.048280973, 0.061467964, -0.040577415, 0.016477052, -0.0065567167, -0.028995331, -0.012464783, -0.019432757, -0.024260854, -0.018536683, -0.013327421, 0.01...
ProphetNet
[ 0.025865965, -0.0022275872, -0.039707284, -0.0058104703, 0.035439543, 0.030998787, -0.026529195, -0.033738215, -0.049915254, 0.060728785, 0.026658956, -0.032065723, 0.011815584, -0.012673457, -0.023645585, -0.0094582345, -0.015081271, -0.009299636, -0.051241715, -0.0106477225, ...
ProphetNet is a model with absolute position embeddings so it's usually advised to pad the inputs on the right rather than the left. The model architecture is based on the original Transformer, but replaces the “standard” self-attention mechanism in the decoder by a a main self-attention mechanism and a self and n-st...
[ 0.04602776, -0.008815014, -0.027170327, 0.0057011656, 0.016249195, -0.009568195, -0.0047806106, -0.026849527, -0.0324147, 0.06365779, 0.039472293, -0.029708827, 0.0073225982, -0.038942274, -0.015970238, -0.013815302, -0.010872315, -0.03313999, -0.04973788, -0.020921709, 0.019...
Overview The 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 13 Jan, 2020. ProphetNet is an encoder-decoder model and can predict n-future tokens for "ngram...
[ 0.0020283824, -0.005035298, -0.020326946, -0.0065511945, -0.0007803385, 0.0030898417, -0.020778066, 0.028314428, -0.015046186, 0.045748897, 0.025846535, -0.020486165, 0.019517584, -0.030384274, -0.03794717, 0.020114655, -0.012518586, -0.049437467, -0.0710647, -0.025421951, 0....
ProphetNetConfig [[autodoc]] ProphetNetConfig ProphetNetTokenizer [[autodoc]] ProphetNetTokenizer ProphetNet specific outputs [[autodoc]] models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqLMOutput [[autodoc]] models.prophetnet.modeling_prophetnet.ProphetNetSeq2SeqModelOutput [[autodoc]] models.prophetnet.modelin...
[ 0.04034268, 0.028828694, -0.021031246, -0.02498098, -0.046259996, 0.0074986666, -0.013889658, 0.016381927, 0.02257616, 0.039847143, 0.0137511995, -0.029222209, 0.013437844, -0.045443814, -0.022080623, 0.031831075, -0.021541359, -0.05401372, -0.02151221, 0.0009910774, -0.00259...
from transformers import GPTNeoXForCausalLM, GPTNeoXTokenizerFast model = GPTNeoXForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b") tokenizer = GPTNeoXTokenizerFast.from_pretrained("EleutherAI/gpt-neox-20b") prompt = "GPTNeoX20B is a 20B-parameter autoregressive Transformer model developed by EleutherAI." input_i...
[ 0.064463794, 0.001906478, -0.0030208405, -0.01103921, -0.024656394, -0.011024808, -0.020393373, -0.011176029, 0.0040433896, 0.05259647, 0.007618711, -0.002250328, 0.012292192, -0.054353524, -0.01914039, 0.025390903, -0.010607147, -0.039519362, -0.021862388, 0.01625997, 0.0195...
GPT-NeoX Overview We introduce GPT-NeoX-20B, a 20 billion parameter autoregressive language model trained on the Pile, whose weights will be made freely and openly available to the public through a permissive license. It is, to the best of our knowledge, the largest dense autoregressive model that has publicly availab...
[ 0.01621683, 0.037409782, -0.028923715, -0.031396966, -0.04816176, -0.019045519, -0.0071902014, -0.00634974, 0.014920964, 0.041526932, 0.028775616, -0.038476095, 0.047095448, -0.07239074, 0.018216165, 0.07499728, -0.0227628, -0.028731186, -0.014684006, -0.015802152, 0.02433264...
pip install -U flash-attn --no-build-isolation Usage To load a model using Flash Attention 2, we can pass the argument attn_implementation="flash_attention_2" to .from_pretrained. We'll also load the model in half-precision (e.g. torch.float16), since it results in almost no degradation to audio quality but significant...
[ -0.002120078, 0.031043252, -0.041940525, -0.012434066, -0.010527044, -0.032831524, 0.00868289, -0.009423345, 0.0033512602, 0.042694952, -0.0031224873, 0.009870413, 0.041158155, -0.028542468, 0.014683375, 0.04769652, 0.00770493, -0.033502124, -0.03034471, -0.0019122616, 0.0258...
Using Flash Attention 2 Flash Attention 2 is an faster, optimized version of the model. Installation First, check whether your hardware is compatible with Flash Attention 2. The latest list of compatible hardware can be found in the official documentation. If your hardware is not compatible with Flash Attention 2, you ...
[ 0.016184535, 0.01276232, -0.017469734, -0.03831685, -0.034042817, -0.0052416674, 0.0020025186, -0.01773873, 0.031203426, 0.0615102, 0.020114852, -0.008271597, 0.019263035, -0.057804048, -0.0048232307, 0.057535052, -0.032040298, -0.03329561, -0.0020996558, 0.011484594, 0.03712...
from transformers import GPTNeoXForCausalLM, GPTNeoXTokenizerFast model = GPTNeoXForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b", torch_dtype=torch.float16, attn_implementation="flash_attention_2").to(device) Expected speedups Below is an expected speedup diagram that compares pure inference time between the na...
[ -0.0025317257, -0.010584068, -0.044497415, 0.012052538, -0.0040175123, 0.00061648036, -0.01019617, -0.006455727, -0.030782457, 0.058073837, 0.0031222308, -0.0059673917, 0.011235181, -0.04876429, -0.020503167, 0.018522117, -0.046215247, -0.023356987, -0.043832447, -0.015031038, ...
Causal language modeling task guide GPTNeoXConfig [[autodoc]] GPTNeoXConfig GPTNeoXTokenizerFast [[autodoc]] GPTNeoXTokenizerFast GPTNeoXModel [[autodoc]] GPTNeoXModel - forward GPTNeoXForCausalLM [[autodoc]] GPTNeoXForCausalLM - forward GPTNeoXForQuestionAnswering [[autodoc]] GPTNeoXForQuestionAnswering -...
[ 0.00872402, 0.009630818, -0.033945505, -0.012832752, 0.0035490189, 0.0051343516, -0.039673965, -0.029092574, -0.047203515, 0.02911759, 0.008980425, -0.00890538, 0.017272934, -0.067790955, -0.0011694565, -0.009511996, -0.0024827498, -0.024814991, -0.056934394, -0.04462696, 0.0...
Resources Causal language modeling task guide
[ 0.012586894, 0.0033462276, 0.0064856964, 0.036911882, 0.014262728, -0.0072619487, -0.0026080625, -0.017628906, -0.0140015595, 0.033545706, -0.0106208725, -0.007820561, 0.04573359, -0.019877862, -0.02891721, -0.01851398, -0.040916476, -0.030237565, -0.038623992, -0.020226087, ...
FSMT Overview FSMT (FairSeq MachineTranslation) models were introduced in Facebook FAIR's WMT19 News Translation Task Submission by Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, Sergey Edunov. The abstract of the paper is the following: This paper describes Facebook FAIR's submission to the WMT19 shared...
[ 0.011422876, -0.031219719, 0.015918966, 0.023829274, 0.0076503768, -0.00076398393, -0.021525027, -0.0051388894, 0.0013786836, 0.019909246, 0.027468296, 0.005346131, 0.03372067, -0.026498826, -0.0034423184, 0.008640922, -0.019431535, -0.013200237, -0.05386877, -0.015750363, 0....
FSMT uses source and target vocabulary pairs that aren't combined into one. It doesn't share embeddings tokens either. Its tokenizer is very similar to [XLMTokenizer] and the main model is derived from [BartModel].
[ 0.00804342, -0.011005564, -0.02222768, 0.03665943, -0.012598779, 0.0071656043, -0.009791316, -0.005158616, 0.021949254, 0.020371508, 0.00804342, 0.007161737, -0.0114154685, -0.016891181, 0.0039791726, -0.013202036, -0.029899865, -0.052313164, 0.0027939281, 0.0044316147, 0.027...
mT5
[ -0.004178922, -0.006884724, 0.011249903, 0.011635962, -0.03922904, 0.012563859, -0.00757218, 0.017663905, -0.011270221, 0.03329592, 0.0131734265, -0.011073805, 0.036817864, -0.017433625, -0.01744717, 0.024504604, -0.0072741695, -0.03386485, -0.07222695, -0.0022570922, 0.00180...
FSMTConfig [[autodoc]] FSMTConfig FSMTTokenizer [[autodoc]] FSMTTokenizer - build_inputs_with_special_tokens - get_special_tokens_mask - create_token_type_ids_from_sequences - save_vocabulary FSMTModel [[autodoc]] FSMTModel - forward FSMTForConditionalGeneration [[autodoc]] FSMTForConditionalGenerat...
[ 0.029607087, -0.009659312, -0.0038045107, 0.014551883, -0.00029283258, -0.016121058, 0.013130743, -0.03354483, -0.009178197, 0.04207167, -0.00019152084, -0.0010926866, 0.0034825336, -0.039910354, -0.016476344, -0.018149145, 0.00027294032, -0.008726689, -0.030909799, 0.004196804...
Overview The mT5 model was presented in mT5: A massively multilingual pre-trained text-to-text transformer by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel. The abstract from the paper is the following: The recent "Text-to-Text Transfer Transformer" (T...
[ 0.041209605, -0.04756749, -0.013226154, 0.027181424, -0.012409545, 0.008355663, 0.02394415, 0.008224422, 0.0056360625, 0.05722098, 0.04263867, 0.027370993, -0.010717997, -0.04995899, -0.01017116, 0.021523487, -0.025037823, -0.022908807, -0.047859136, 0.025606534, -0.011534606...
google/mt5-small google/mt5-base google/mt5-large google/mt5-xl google/mt5-xxl. This model was contributed by patrickvonplaten. The original code can be found here. Resources Translation task guide Summarization task guide MT5Config [[autodoc]] MT5Config MT5Tokenizer [[autodoc]] MT5Tokenizer See [T5Tokenizer] fo...
[ 0.007356726, -0.026177961, -0.022822496, 0.019253984, -0.013475126, -0.0013972786, -0.006977239, 0.000011377855, -0.00007625113, 0.04364769, 0.018295279, 0.019240668, 0.045724884, -0.024140714, -0.019853175, 0.004953307, -0.02809537, -0.06806803, -0.053687457, -0.0063480893, ...
MT5Model [[autodoc]] MT5Model MT5ForConditionalGeneration [[autodoc]] MT5ForConditionalGeneration MT5EncoderModel [[autodoc]] MT5EncoderModel MT5ForSequenceClassification [[autodoc]] MT5ForSequenceClassification MT5ForTokenClassification [[autodoc]] MT5ForTokenClassification MT5ForQuestionAnswering [[autodoc]] MT5ForQu...
[ 0.008185939, -0.036943667, 0.0115043875, -0.0027626734, -0.014025631, -0.007135961, -0.014233034, 0.035802953, 0.007816503, 0.023488395, 0.0390177, -0.026832769, 0.04635458, -0.041402835, -0.019482924, 0.0005898024, -0.02057179, -0.023216179, -0.034765936, 0.021647694, -0.031...
ConvBERT
[ 0.02094739, -0.029678684, -0.011502419, 0.027132591, -0.020870235, -0.0071817786, 0.0040216674, 0.016382428, 0.020304438, 0.045598187, 0.018028386, 0.01837558, 0.04258917, -0.022606207, -0.016035233, 0.018298425, -0.0055326056, -0.069953226, -0.053185023, 0.0071689193, 0.0290...
TFMT5Model [[autodoc]] TFMT5Model TFMT5ForConditionalGeneration [[autodoc]] TFMT5ForConditionalGeneration TFMT5EncoderModel [[autodoc]] TFMT5EncoderModel FlaxMT5Model [[autodoc]] FlaxMT5Model FlaxMT5ForConditionalGeneration [[autodoc]] FlaxMT5ForConditionalGeneration FlaxMT5EncoderModel [[autodoc]] FlaxMT5EncoderModel
[ 0.022797907, -0.012926356, -0.026588129, -0.0062722526, 0.011017103, 0.013393063, 0.005950508, -0.0049782027, -0.0005316742, 0.039542772, 0.030378351, -0.018441979, 0.028638808, -0.062057823, 0.012381866, -0.011695948, -0.0015070732, -0.03139662, -0.026192136, -0.019644102, -...
Overview The ConvBERT model was proposed in ConvBERT: Improving BERT with Span-based Dynamic Convolution by Zihang Jiang, Weihao Yu, Daquan Zhou, Yunpeng Chen, Jiashi Feng, Shuicheng Yan. The abstract from the paper is the following: Pre-trained language models like BERT and its variants have recently achieved impres...
[ 0.010411633, -0.01863275, -0.026686905, 0.01461235, -0.021597961, 0.000057757763, -0.008261186, -0.00065907504, -0.0030486917, 0.038467612, 0.0014500486, 0.0075332406, 0.020155424, -0.06742517, -0.020983547, 0.010411633, -0.037773058, -0.030747375, -0.05764799, -0.009516726, ...
Text classification task guide Token classification task guide Question answering task guide Masked language modeling task guide Multiple choice task guide ConvBertConfig [[autodoc]] ConvBertConfig ConvBertTokenizer [[autodoc]] ConvBertTokenizer - build_inputs_with_special_tokens - get_special_tokens_mask ...
[ 0.001757332, -0.03253844, 0.0020201735, 0.016902737, -0.023103103, 0.015972681, 0.0057690362, 0.02213261, 0.0071304208, 0.08011951, 0.018951554, 0.03237669, 0.030300919, -0.027793813, -0.045451377, 0.04143462, -0.0110595655, -0.053916223, -0.04555921, -0.026621137, -0.0023520...
ConvBertModel [[autodoc]] ConvBertModel - forward ConvBertForMaskedLM [[autodoc]] ConvBertForMaskedLM - forward ConvBertForSequenceClassification [[autodoc]] ConvBertForSequenceClassification - forward ConvBertForMultipleChoice [[autodoc]] ConvBertForMultipleChoice - forward ConvBertForTokenClassificati...
[ -0.0064842138, -0.030279709, 0.0017788995, 0.01690372, -0.021594003, 0.0060599507, 0.008725794, 0.019709872, 0.01898829, 0.051285755, 0.028382216, 0.028729644, 0.042626776, -0.014177745, -0.0454062, 0.03287206, -0.009093267, -0.054065183, -0.046635564, -0.042573325, 0.0060198...
TFConvBertModel [[autodoc]] TFConvBertModel - call TFConvBertForMaskedLM [[autodoc]] TFConvBertForMaskedLM - call TFConvBertForSequenceClassification [[autodoc]] TFConvBertForSequenceClassification - call TFConvBertForMultipleChoice [[autodoc]] TFConvBertForMultipleChoice - call TFConvBertForTokenClassi...
[ 0.017649941, 0.00083878683, -0.010704682, -0.025196431, -0.00480294, -0.028071284, 0.015742585, 0.0078090965, 0.00003846779, 0.09182945, 0.023924861, -0.01156852, 0.018935332, -0.027877783, -0.026910285, 0.046522867, 0.0092810765, -0.054760426, -0.009723362, -0.037179593, 0.0...
SAM Overview SAM (Segment Anything Model) was proposed in Segment Anything by Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alex Berg, Wan-Yen Lo, Piotr Dollar, Ross Girshick. The model can be used to predict segmentation masks of any object of i...
[ 0.030269379, -0.010113771, -0.0027658213, -0.029780235, -0.01808394, -0.022414302, 0.014436941, 0.003641605, 0.0036236218, 0.078953594, 0.03418253, -0.010379923, -0.001039431, -0.01317092, 0.008567213, 0.011293471, 0.0027640231, -0.013084601, -0.031851903, -0.0026291488, 0.02...
The model predicts binary masks that states the presence or not of the object of interest given an image. The model predicts much better results if input 2D points and/or input bounding boxes are provided You can prompt multiple points for the same image, and predict a single mask. Fine-tuning the model is not support...
[ 0.049225587, 0.008107025, -0.01970109, -0.010807105, 0.02301174, -0.06116564, 0.0050575626, 0.015807003, 0.014735112, 0.07082623, 0.03636289, -0.004138314, 0.030827047, -0.04811299, -0.00525091, 0.018697038, 0.025182659, -0.02533191, -0.015630616, -0.018262856, 0.011139528, ...
The abstract from the paper is the following: We introduce the Segment Anything (SA) project: a new task, model, and dataset for image segmentation. Using our efficient model in a data collection loop, we built the largest segmentation dataset to date (by far), with over 1 billion masks on 11M licensed and privacy re...
[ 0.04571711, -0.0044865427, -0.011642197, -0.011763866, -0.025352767, -0.011588967, -0.00048073492, 0.006653771, -0.0038173632, 0.051040124, -0.0067222095, 0.009003502, 0.061990328, -0.027892606, -0.0036747826, 0.059435282, -0.001988527, -0.049275924, -0.01238742, -0.016379682, ...
This model was contributed by ybelkada and ArthurZ. The original code can be found here. Below is an example on how to run mask generation given an image and a 2D point: thon import torch from PIL import Image import requests from transformers import SamModel, SamProcessor device = "cuda" if torch.cuda.is_available()...
[ 0.048409637, -0.002642733, -0.027880365, -0.02324858, 0.006917797, -0.004699022, 0.006219294, -0.00023322352, 0.008531451, 0.051726595, -0.0038996653, 0.028343543, 0.05719509, -0.043957148, -0.0047326395, 0.0626337, 0.0042283726, -0.06275324, -0.03236274, -0.038638063, -0.004...
You can also process your own masks alongside the input images in the processor to be passed to the model. thon import torch from PIL import Image import requests from transformers import SamModel, SamProcessor device = "cuda" if torch.cuda.is_available() else "cpu" model = SamModel.from_pretrained("facebook/sam-vit-...
[ 0.018877774, 0.0068918285, -0.014410514, -0.0048743566, -0.025319273, -0.024786085, -0.017566416, -0.002046293, -0.014086278, 0.033864707, -0.006841392, 0.025333684, 0.031011427, -0.027394388, -0.006344229, 0.02213455, -0.022177782, -0.011888674, -0.046027184, -0.02354678, 0....
Falcon Overview Falcon is a class of causal decoder-only models built by TII. The largest Falcon checkpoints have been trained on >=1T tokens of text, with a particular emphasis on the RefinedWeb corpus. They are made available under the Apache 2.0 license. Falcon's architecture is modern and optimized for inference, ...
[ 0.049073387, 0.006626587, 0.008397749, 0.011161371, -0.00009644289, -0.029819641, 0.044187427, -0.0054623536, 0.0071953437, 0.005878424, -0.004027102, -0.011810288, 0.038385343, -0.07084646, 0.016917646, 0.015627446, 0.020582117, -0.0143830525, -0.040584028, -0.0080923755, 0....
Falcon models were initially added to the Hugging Face Hub as custom code checkpoints. However, Falcon is now fully supported in the Transformers library. If you fine-tuned a model from a custom code checkpoint, we recommend converting your checkpoint to the new in-library format, as this should give significant improv...
[ 0.030231716, -0.048787538, 0.017271187, 0.039167058, -0.011083535, -0.012796381, -0.008557089, -0.023622988, -0.0248648, 0.04145085, 0.0176994, 0.03462802, 0.018113337, -0.014387899, -0.05692355, 0.057094835, 0.03063138, -0.027177142, -0.053012554, -0.0008028961, 0.028147753,...
SlimSAM SlimSAM, a pruned version of SAM, was proposed in 0.1% Data Makes Segment Anything Slim by Zigeng Chen et al. SlimSAM reduces the size of the SAM models considerably while maintaining the same performance. Checkpoints can be found on the hub, and they can be used as a drop-in replacement of SAM. SamConfig [[a...
[ 0.049098793, -0.0005933061, -0.024146037, -0.008797447, -0.029514913, -0.03123963, 0.025620392, 0.008720947, 0.0005859169, 0.04225556, -0.0029313231, 0.0032042875, 0.034967244, -0.044842638, -0.00924949, 0.05368877, 0.03416052, -0.056554023, -0.018179072, -0.03332598, -0.0080...
Resources A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with SAM. Demo notebook for using the model. Demo notebook for using the automatic mask generation pipeline. Demo notebook for inference with MedSAM, a fine-tuned version of SAM on the medical domain. 🌎 Demo no...
[ 0.026609642, -0.0074986797, 0.009213294, 0.027301375, -0.011222264, -0.04282857, 0.015203407, 0.009272166, 0.0030704848, 0.03302657, 0.005835577, 0.010736578, 0.030524556, -0.04762655, -0.006556745, 0.04162172, 0.006243994, -0.007881341, -0.04432978, -0.022179607, 0.006567783...
You can convert custom code checkpoints to full Transformers checkpoints using the convert_custom_code_checkpoint.py script located in the Falcon model directory of the Transformers library. To use this script, simply call it with python convert_custom_code_checkpoint.py --checkpoint_dir my_model. This will convert...
[ 0.021897223, -0.029772539, -0.016858792, -0.0072288904, 0.011288446, -0.010926448, -0.000152141, -0.025236474, -0.008820945, 0.06607583, -0.024527254, -0.005455836, 0.020035515, -0.019001232, -0.015514227, 0.00010446707, -0.022429138, -0.047606513, -0.074882, -0.030555638, -0...
BARThez Overview The BARThez model was proposed in BARThez: a Skilled Pretrained French Sequence-to-Sequence Model by Moussa Kamal Eddine, Antoine J.-P. Tixier, Michalis Vazirgiannis on 23 Oct, 2020. The abstract of the paper: Inductive transfer learning, enabled by self-supervised learning, have taken the entire Natu...
[ 0.018669674, -0.031183558, 0.0056536454, -0.0018171142, 0.00021855945, 0.015375026, -0.03132806, -0.0133519955, 0.003403025, 0.09068953, -0.023423793, -0.02118401, 0.01627094, -0.03196387, 0.007853691, 0.00089501, -0.025360122, -0.05248317, -0.0816148, 0.0057258965, -0.007058...
Resources BARThez can be fine-tuned on sequence-to-sequence tasks in a similar way as BART, check: examples/pytorch/summarization/. BarthezTokenizer [[autodoc]] BarthezTokenizer BarthezTokenizerFast [[autodoc]] BarthezTokenizerFast
[ 0.021665748, 0.005029549, -0.011801973, -0.017143287, -0.00691516, 0.006314168, -0.014153353, -0.010344569, -0.03086092, 0.046546802, -0.0077002053, -0.0031946462, 0.021184955, -0.007467321, -0.04657685, -0.016346972, -0.01831522, -0.004901838, -0.055621777, -0.028471978, 0.0...
LUKE Overview The LUKE model was proposed in LUKE: Deep Contextualized Entity Representations with Entity-aware Self-attention by Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda and Yuji Matsumoto. It is based on RoBERTa and adds entity embeddings as well as an entity-aware self-attention mechanism, which he...
[ 0.016256284, 0.011946583, -0.006981866, -0.027689276, -0.012088006, 0.010569562, -0.00867895, 0.00972102, -0.012221986, 0.04245689, 0.0036546867, 0.016509358, 0.004294815, -0.007048856, -0.049275003, -0.016345605, -0.012177327, -0.010271829, -0.051478233, -0.014134929, 0.0153...
This implementation is the same as [RobertaModel] with the addition of entity embeddings as well as an entity-aware self-attention mechanism, which improves performance on tasks involving reasoning about entities. LUKE treats entities as input tokens; therefore, it takes entity_ids, entity_attention_mask, entity_to...
[ 0.010089803, 0.0014672134, 0.011809983, 0.017172901, -0.014462532, 0.02281047, -0.00081762817, -0.0051171775, 0.006790379, 0.04790488, 0.0061326628, -0.0082322955, -0.030847618, -0.006645826, -0.037728343, -0.01902318, -0.034345802, -0.023677789, -0.05229929, -0.012330375, -0...
[LukeTokenizer] takes entities and entity_spans (character-based start and end positions of the entities in the input text) as extra input. entities typically consist of [MASK] entities or Wikipedia entities. The brief description when inputting these entities are as follows:
[ 0.0025550562, 0.027301185, -0.009539822, -0.028307615, -0.03903814, -0.0017639103, -0.008377466, 0.0023743242, -0.016003653, 0.019915974, 0.025330849, -0.016896684, -0.00050675875, -0.001476865, -0.045700423, -0.028477715, -0.0008775254, 0.0052624946, -0.039633494, -0.023686541...
Inputting [MASK] entities to compute entity representations: The [MASK] entity is used to mask entities to be predicted during pretraining. When LUKE receives the [MASK] entity, it tries to predict the original entity by gathering the information about the entity from the input text. Therefore, the [MASK] entit...
[ 0.046391103, 0.012672871, -0.005975616, -0.029366305, -0.017672801, 0.014852517, -0.011929141, -0.0044218823, -0.018114623, 0.03896853, -0.0012426189, -0.01138423, 0.013490239, -0.023018824, -0.014145605, -0.010309135, -0.005382841, -0.0028221256, -0.035934698, -0.02226773, 0...
Inputting Wikipedia entities to compute knowledge-enhanced token representations: LUKE learns rich information (or knowledge) about Wikipedia entities during pretraining and stores the information in its entity embedding. By using Wikipedia entities as input tokens, LUKE outputs token representations enriched b...
[ 0.007941594, 0.0131074125, 0.016140345, -0.014816746, -0.008592049, -0.0022368825, -0.0063494937, 0.01058123, -0.00265098, 0.019725408, -0.017955568, -0.036667477, 0.017229479, -0.0044094757, -0.052066606, -0.0031199122, -0.038059145, -0.0044132574, -0.04553181, -0.031494096, ...
[LukeForEntityPairClassification], for tasks to classify the relationship between two entities such as relation classification, e.g. the TACRED dataset. This model places a linear head on top of the concatenated output representation of the pair of given entities. [LukeForEntitySpanClassification], for tasks ...
[ 0.0076406603, -0.008023444, -0.0013575682, -0.015018625, -0.021345813, 0.0081210155, 0.028521128, 0.00029858056, 0.012294107, 0.03014233, 0.021901224, -0.027800594, 0.028716272, -0.00583182, -0.06055486, 0.021961268, -0.02988714, 0.011355912, -0.0562917, -0.013307358, 0.03788...
There are three head models for the former use case: [LukeForEntityClassification], for tasks to classify a single entity in an input text such as entity typing, e.g. the Open Entity dataset. This model places a linear head on top of the output entity representation.
[ 0.03161997, 0.014455889, -0.024066312, -0.030243916, -0.024051672, 0.027125837, -0.0055700922, 0.022822008, 0.008249006, 0.035250414, 0.002552654, -0.017156763, 0.0141997095, -0.029263113, -0.02604256, 0.026657393, -0.035045467, -0.018810956, -0.065113716, -0.05193873, 0.0112...
[LukeTokenizer] has a task argument, which enables you to easily create an input to these head models by specifying task="entity_classification", task="entity_pair_classification", or task="entity_span_classification". Please refer to the example code of each head models. Usage example: thon from transformers impo...
[ 0.017981943, -0.011535587, -0.0008435951, 0.0007274279, 0.01163147, -0.012936968, -0.0055170194, -0.0076928493, -0.024221782, 0.020091392, 0.01183799, -0.0360819, -0.02495935, -0.010665255, -0.04003527, 0.0022864654, -0.025962446, -0.04086135, -0.0626049, -0.028514436, 0.0364...
Example 1: Computing the contextualized entity representation corresponding to the entity mention "Beyoncé" text = "Beyoncé lives in Los Angeles." entity_spans = [(0, 7)] # character-based entity span corresponding to "Beyoncé" inputs = tokenizer(text, entity_spans=entity_spans, add_prefix_space=True, return_tensors=...
[ 0.023835579, -0.0012578099, -0.0033659702, -0.034787063, 0.0015823281, 0.030251859, -0.014211158, -0.024917843, 0.011453962, 0.01339946, 0.03166911, -0.03623008, 0.014262695, -0.01839849, -0.024015956, -0.023126954, -0.009946522, -0.028989218, -0.055865444, -0.039631482, 0.03...
Example 2: Inputting Wikipedia entities to obtain enriched contextualized representations
[ 0.014170544, -0.004182596, 0.020874888, 0.008517563, -0.0056796456, -0.014109596, 0.012448747, -0.017675087, -0.03135804, 0.003468355, 0.016852282, -0.011526899, -0.011930684, -0.020265402, -0.062777035, 0.0010380305, -0.04028701, -0.0070395605, -0.06551972, -0.0083270995, 0....
entities = [ "Beyoncé", "Los Angeles", ] # Wikipedia entity titles corresponding to the entity mentions "Beyoncé" and "Los Angeles" entity_spans = [(0, 7), (17, 28)] # character-based entity spans corresponding to "Beyoncé" and "Los Angeles" inputs = tokenizer(text, entities=entities, entity_spans=entity_s...
[ 0.012918977, 0.040263336, 0.0041686436, -0.018312875, -0.042706903, 0.0035091578, -0.005872893, -0.0005375676, 0.02876746, 0.0015176848, 0.0070599676, -0.011329269, 0.022422513, 0.0010117899, -0.062310982, 0.004873252, -0.039652444, 0.013654824, -0.021603363, -0.04376208, 0.0...
Example 3: Classifying the relationship between two entities using LukeForEntityPairClassification head model
[ 0.018253643, -0.011992866, -0.012152864, 0.016514538, -0.03981854, -0.007825972, -0.012806768, 0.03853856, 0.0036451635, 0.04427065, 0.006525121, 0.0402081, 0.039234202, -0.008104228, -0.061606046, 0.03558904, -0.032472562, -0.029689996, -0.049001016, -0.009572033, -0.0038921...
LukeConfig [[autodoc]] LukeConfig LukeTokenizer [[autodoc]] LukeTokenizer - call - save_vocabulary LukeModel [[autodoc]] LukeModel - forward LukeForMaskedLM [[autodoc]] LukeForMaskedLM - forward LukeForEntityClassification [[autodoc]] LukeForEntityClassification - forward LukeForEntityPairClassifi...
[ 0.043342162, -0.0012894294, -0.029963883, 0.0010456297, 0.0042403084, -0.0091451965, -0.01775584, -0.030772936, -0.027695643, 0.05891645, 0.039874792, 0.0014763424, 0.008155551, -0.03036841, 0.018752709, 0.0027738984, 0.033113413, -0.014454612, -0.051519386, -0.027406694, 0.0...
FocalNet Overview The FocalNet model was proposed in Focal Modulation Networks by Jianwei Yang, Chunyuan Li, Xiyang Dai, Lu Yuan, Jianfeng Gao. FocalNets completely replace self-attention (used in models like ViT and Swin) by a focal modulation mechanism for modeling token interactions in vision. The authors claim tha...
[ -0.0052548125, -0.0090161525, -0.025681414, 0.01573283, -0.0012969114, -0.020671563, 0.01193198, -0.0067364327, 0.0040537124, 0.054776482, 0.031212796, -0.0033366084, 0.013378042, -0.010201448, -0.02485961, 0.019928778, -0.025807846, -0.04311317, -0.05613562, -0.0021374838, 0...
ERNIE Overview ERNIE is a series of powerful models proposed by baidu, especially in Chinese tasks, including ERNIE1.0, ERNIE2.0, ERNIE3.0, ERNIE-Gram, ERNIE-health, etc. These models are contributed by nghuyong and the official code can be found in PaddleNLP (in PaddlePaddle). Usage example Take ernie-1.0-base-zh as ...
[ 0.017220693, 0.027291186, 0.01525627, 0.008881302, -0.017943239, -0.022700004, 0.0033210798, 0.009641481, -0.02617726, 0.02431068, -0.018500203, 0.013683225, 0.0013425442, -0.04076367, -0.023091383, 0.010642509, -0.037542313, -0.042268973, -0.0705085, -0.023844035, 0.00436162...
model = LukeForEntityPairClassification.from_pretrained("studio-ousia/luke-large-finetuned-tacred") tokenizer = LukeTokenizer.from_pretrained("studio-ousia/luke-large-finetuned-tacred") entity_spans = [(0, 7), (17, 28)] # character-based entity spans corresponding to "Beyoncé" and "Los Angeles" inputs = tokenizer(te...
[ 0.018348005, 0.01424108, -0.0077372794, 0.005519119, -0.036499776, -0.01590908, 0.003938724, 0.020114124, 0.003959749, 0.02447335, -0.032519, -0.0061323545, 0.021810157, -0.021641955, -0.026001183, -0.010442523, -0.0038651354, -0.028762495, -0.04059268, -0.012488978, -0.02625...
Resources A demo notebook on how to fine-tune [LukeForEntityPairClassification] for relation classification Notebooks showcasing how you to reproduce the results as reported in the paper with the HuggingFace implementation of LUKE Text classification task guide Token classification task guide Question answering task g...
[ -0.021523518, 0.004742353, -0.028854491, 0.023497773, -0.030428372, -0.021012697, -0.0036413264, 0.010375191, -0.020529488, 0.048210472, 0.028633596, 0.012860267, 0.003931252, -0.04649853, -0.020888442, 0.02141307, -0.010354483, -0.016291052, -0.06781496, -0.017105605, -0.002...
ErnieConfig [[autodoc]] ErnieConfig - all Ernie specific outputs [[autodoc]] models.ernie.modeling_ernie.ErnieForPreTrainingOutput ErnieModel [[autodoc]] ErnieModel - forward ErnieForPreTraining [[autodoc]] ErnieForPreTraining - forward ErnieForCausalLM [[autodoc]] ErnieForCausalLM - forward ErnieForM...
[ 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.03422353, -0.000011967525, 0.030459521, -0.03746637, -0.0011771577, -0.0491348, -0.01732892, -0.0053383787, 0.008649983, 0.055301983, 0.0039920215, -0.010329311, 0.02232347, -0.0210495, 0.0001365132, 0.04099875, 0.020759959, -0.040593393, -0.039580006, -0.01585227, 0.002158...
from PIL import Image import requests from transformers import CLIPProcessor, CLIPModel model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32") processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32") url = "http://images.cocodataset.org/val2017/000000039769.jpg" image = Image.open(requests...
[ 0.02381219, -0.024759939, 0.010573323, -0.01065477, -0.012342948, -0.04030894, -0.021072604, -0.024404533, -0.005897515, 0.054643642, 0.0008431633, -0.045788117, 0.03962775, -0.010921325, 0.019488085, 0.024448957, 0.011032389, 0.0038909533, -0.058405023, 0.0066268374, -0.0007...
CLIP Overview The CLIP model was proposed in Learning Transferable Visual Models From Natural Language Supervision by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. CLIP (Contrastive L...
[ 0.015528111, -0.014938782, 0.0009413831, -0.02320308, -0.011896204, -0.022408172, -0.021202106, 0.0043548606, 0.003666169, 0.054656755, -0.018913321, 0.007935371, 0.021078758, -0.029767921, -0.013342114, 0.008819364, 0.029137477, -0.037908874, -0.035907898, -0.0050229942, -0....
A notebook on how to use a pretrained CLIP for inference with beam search for image captioning. 🌎 Image retrieval A notebook on image retrieval using pretrained CLIP and computing MRR(Mean Reciprocal Rank) score. 🌎 A notebook on image retrieval and showing the similarity score. 🌎 A notebook on how to map images an...
[ -0.0034363493, 0.0056784265, 0.01769626, -0.01500727, -0.040470056, -0.011995301, -0.00057835825, -0.012160545, 0.009756979, 0.028181821, 0.013016816, 0.016464433, 0.029143248, -0.023630066, 0.034701496, -0.007255767, 0.04116108, -0.02588341, -0.05858694, -0.020235028, -0.024...
Resources A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with CLIP. Fine tuning CLIP with Remote Sensing (Satellite) images and captions, a blog post about how to fine-tune CLIP with RSICD dataset and comparison of performance changes due to data augmentation. This ex...
[ 0.0010890699, -0.040997136, 0.0024704514, -0.007209242, -0.0029899313, 0.0049843322, 0.0027477301, 0.019683436, 0.0063172737, 0.036854662, -0.00043637963, -0.006581189, 0.032097496, -0.001899191, -0.008826143, 0.053504735, 0.014311581, -0.06248455, -0.051553763, 0.0038952623, ...
CLIPModel [[autodoc]] CLIPModel - forward - get_text_features - get_image_features CLIPTextModel [[autodoc]] CLIPTextModel - forward CLIPTextModelWithProjection [[autodoc]] CLIPTextModelWithProjection - forward CLIPVisionModelWithProjection [[autodoc]] CLIPVisionModelWithProjection - forward CLI...
[ 0.008776769, -0.036753144, 0.023233814, 0.0078120665, 0.00944464, -0.010901813, 0.021102024, 0.031760976, 0.009768456, 0.037697606, -0.013829651, 0.007393804, 0.016028903, -0.006874349, -0.01353282, 0.030897465, 0.03880398, -0.043472327, -0.04671049, -0.025824344, -0.00111480...
TFCLIPModel [[autodoc]] TFCLIPModel - call - get_text_features - get_image_features TFCLIPTextModel [[autodoc]] TFCLIPTextModel - call TFCLIPVisionModel [[autodoc]] TFCLIPVisionModel - call
[ 0.036552496, 0.0010892525, 0.016659351, -0.020091945, 0.0027202321, -0.026413752, 0.009138124, -0.0073356805, -0.0013816525, 0.07390019, 0.0073886937, 0.017706359, 0.0016202113, -0.043126114, -0.034299444, 0.006060054, 0.01795817, -0.04469, -0.030376477, -0.019084698, -0.0152...
Explainability A notebook on how to visualize similarity between input token and image segment. 🌎
[ 0.022158723, 0.03593, -0.03403149, -0.005206733, 0.0154431, 0.010590566, -0.02989444, -0.028931018, 0.010016763, 0.07679046, 0.016250674, -0.02028855, 0.00450896, -0.0405771, 0.009074592, -0.03853691, -0.016434858, -0.049842957, -0.053526632, -0.0058690864, 0.043354023, 0.0...
Informer Overview The Informer model was proposed in Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting by Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. This method introduces a Probabilistic Attention mechanism to select the "active" queri...
[ 0.025303366, -0.024575116, -0.008407974, 0.011453381, -0.05267231, -0.021053037, -0.03506191, 0.019093383, 0.0054188394, 0.04102032, 0.0048594116, -0.013101874, 0.035141356, -0.0413381, 0.007520833, 0.036465447, 0.021384059, -0.03956382, -0.05407585, -0.010367627, -0.00699119...
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. CLIPConfig [[autodoc]] CLIPConfig - from_text_vision_configs CLIPTextConfig [[autodoc...
[ 0.007502115, -0.029980648, 0.0038032038, -0.013057435, 0.014350663, -0.009358523, -0.02028839, 0.04555501, 0.016867591, 0.038018133, 0.0171318, 0.0038831613, 0.025697699, -0.0066469153, 0.0017025769, 0.052730344, 0.017340384, -0.05962756, -0.040743645, 0.01583857, 0.013940445...
FlaxCLIPModel [[autodoc]] FlaxCLIPModel - call - get_text_features - get_image_features FlaxCLIPTextModel [[autodoc]] FlaxCLIPTextModel - call FlaxCLIPTextModelWithProjection [[autodoc]] FlaxCLIPTextModelWithProjection - call FlaxCLIPVisionModel [[autodoc]] FlaxCLIPVisionModel - call