repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
VecConstNMT
VecConstNMT-master/fairseq/models/roberta/model.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ RoBERTa: A Robustly Optimized BERT Pretraining Approach. """ import logging import torch import torch.nn as nn import torch.nn.functional...
17,545
42.755611
122
py
VecConstNMT
VecConstNMT-master/fairseq/models/roberta/alignment_utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from collections import Counter from typing import List import torch def align_bpe_to_words(roberta, bpe_tokens: torch.LongTensor, other_to...
4,074
34.12931
98
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/hf_gpt2.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import sys from typing import Dict, List, Optional import torch from fairseq.models import ( FairseqIncrementalD...
7,057
34.114428
86
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/setup.py
""" Simple check list from AllenNLP repo: https://github.com/allenai/allennlp/blob/master/setup.py To create the package for pypi. 1. Change the version in __init__.py, setup.py as well as docs/source/conf.py. 2. Commit these changes with the message: "Release: VERSION" 3. Add a tag in git to mark the release: "git...
5,027
38.28125
197
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/hubconf.py
from transformers import ( AutoConfig, AutoModel, AutoModelForQuestionAnswering, AutoModelForSequenceClassification, AutoModelWithLMHead, AutoTokenizer, ) from transformers.file_utils import add_start_docstrings dependencies = ["torch", "tqdm", "boto3", "requests", "regex", "sentencepiece", "s...
6,511
52.818182
189
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_squad.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
35,397
40.11266
126
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_glue.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
30,147
42.130186
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/benchmarks.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
22,825
41.906015
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_language_modeling.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
34,666
42.33375
165
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_bertology.py
#!/usr/bin/env python3 # Copyright 2018 CMU and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
18,392
42.074941
123
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_generation.py
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
10,147
37.439394
119
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_tf_glue.py
import os import tensorflow as tf import tensorflow_datasets from transformers import ( BertConfig, BertForSequenceClassification, BertTokenizer, TFBertForSequenceClassification, glue_convert_examples_to_features, glue_processors, ) # script parameters BATCH_SIZE = 32 EVAL_BATCH_SIZE = BATCH...
3,933
36.113208
137
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_multiple_choice.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
29,120
41.888071
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/run_xnli.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
28,430
42.472477
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/pplm/run_pplm.py
#! /usr/bin/env python3 # coding=utf-8 # Copyright (c) 2019 Uber Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
28,318
34.621384
191
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/pplm/run_pplm_discrim_train.py
#! /usr/bin/env python3 # coding=utf-8 # Copyright (c) 2019 Uber Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
18,693
35.088803
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/pplm/pplm_classification_head.py
import torch class ClassificationHead(torch.nn.Module): """Classification Head for transformer encoders""" def __init__(self, class_size, embed_size): super().__init__() self.class_size = class_size self.embed_size = embed_size # self.mlp1 = torch.nn.Linear(embed_size, embed_...
655
31.8
63
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/summarization/modeling_bertabs.py
# MIT License # Copyright (c) 2019 Yang Liu and the HuggingFace team # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, c...
38,168
36.129377
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/summarization/convert_bertabs_original_pytorch_checkpoint.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
6,450
35.446328
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/summarization/utils_summarization.py
import os from collections import deque import torch from torch.utils.data import Dataset # ------------ # Data loading # ------------ class SummarizationDataset(Dataset): """ Abstracts the dataset used to train seq2seq models. The class will process the documents that are located in the specified fol...
5,773
33.369048
106
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/summarization/test_utils_summarization.py
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
4,451
43.079208
100
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/summarization/run_summarization.py
#! /usr/bin/python3 import argparse import logging import os import sys from collections import namedtuple import torch from torch.utils.data import DataLoader, SequentialSampler from tqdm import tqdm from modeling_bertabs import BertAbs, build_predictor from transformers import BertTokenizer from utils_summarization...
9,997
29.858025
137
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/hans/test_hans.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
27,668
41.964286
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/mm-imdb/run_mmimdb.py
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
25,142
39.882927
123
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/mm-imdb/utils_mmimdb.py
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
4,541
30.541667
119
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/ner/run_pl_ner.py
import argparse import glob import logging import os import numpy as np import torch from seqeval.metrics import f1_score, precision_score, recall_score from torch.nn import CrossEntropyLoss from torch.utils.data import DataLoader, TensorDataset from transformer_base import BaseTransformer, add_generic_args, generic_...
9,557
41.860987
111
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/ner/run_ner.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
31,260
43.341844
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/ner/transformer_base.py
import logging import os import random import numpy as np import pytorch_lightning as pl import torch from transformers import ( AdamW, BertConfig, BertForTokenClassification, BertTokenizer, CamembertConfig, CamembertForTokenClassification, CamembertTokenizer, DistilBertConfig, Dis...
10,221
35.248227
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/ner/run_tf_ner.py
# coding=utf-8 import collections import datetime import glob import math import os import re import numpy as np import tensorflow as tf from absl import app, flags, logging from seqeval import metrics from transformers import ( TF2_WEIGHTS_NAME, BertConfig, BertTokenizer, DistilBertConfig, Distil...
26,655
39.634146
148
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/contrib/run_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
6,214
41.862069
116
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/contrib/run_swag.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
30,807
40.745257
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/contrib/run_openai_gpt.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
14,226
43.880126
132
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/contrib/run_camembert.py
import torch from transformers.modeling_camembert import CamembertForMaskedLM from transformers.tokenization_camembert import CamembertTokenizer def fill_mask(masked_input, model, tokenizer, topk=5): # Adapted from https://github.com/pytorch/fairseq/blob/master/fairseq/models/roberta/hub_interface.py assert ...
1,901
42.227273
114
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/grouped_batch_sampler.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
4,360
39.009174
125
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/utils.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
4,268
31.097744
90
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/lm_seqs_dataset.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
6,133
35.730539
111
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/run_squad_w_distillation.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
36,089
40.530495
143
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/train.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
12,977
39.179567
122
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/distiller.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
26,139
42.278146
143
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/scripts/extract.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
4,450
42.213592
128
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/examples/distillation/scripts/extract_distilbert.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
4,319
45.451613
128
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_encoder_decoder.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
13,315
55.185654
472
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_albert.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
38,969
46.236364
159
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/optimization.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
7,667
41.837989
130
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_mmbt.py
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
21,362
49.864286
138
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/configuration_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
17,344
47.585434
193
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/optimization_tf.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
9,828
38.793522
115
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_pytorch_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
12,950
38.245455
155
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_distilbert.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
39,945
47.069795
175
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_xlm_roberta.py
# coding=utf-8 # Copyright 2019 Facebook AI Research and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licens...
4,827
39.571429
127
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_gpt2.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
32,916
46.36259
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
34,770
40.943305
159
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_t5.py
# coding=utf-8 # Copyright 2018 T5 Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
37,708
46.492443
193
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_auto.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
68,445
61.622141
472
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
80,040
48.438542
472
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_openai.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
30,610
45.240181
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
71,006
46.055666
187
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_gpt2.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
35,205
46.129853
177
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_flaubert.py
# coding=utf-8 # Copyright 2019-present CNRS, Facebook Inc. and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
17,718
44.904145
150
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_albert_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2,157
33.806452
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_openai.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
32,497
45.827089
177
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_t5_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The T5 authors and HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
2,100
32.887097
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/pipelines.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
60,084
42.382671
146
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_gpt2_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2,507
35.882353
119
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_roberta.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
21,910
48.238202
161
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_roberta_original_pytorch_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
7,910
43.44382
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/tokenization_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
27,042
41.320814
183
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_transfo_xl_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
4,913
38
121
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/configuration_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # htt...
5,769
39.069444
120
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_transfo_xl_utilities.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
7,702
42.03352
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_bart_original_pytorch_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
4,265
36.752212
119
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_t5.py
# coding=utf-8 # Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
43,663
46.512514
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_xlnet.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
59,108
48.339733
171
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_openai_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2,641
34.702703
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_xlm_roberta.py
# coding=utf-8 # Copyright 2019 Facebook AI Research and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licens...
5,431
41.771654
167
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_camembert.py
# coding=utf-8 # Copyright 2019 Inria, Facebook AI Research and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the...
5,589
39.215827
148
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_xlm_original_pytorch_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2,970
36.1375
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_xlm.py
# coding=utf-8 # Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
39,037
46.958231
159
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_bart.py
# coding=utf-8 # Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
60,382
44.366642
166
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/file_utils.py
""" Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP authors. """ import fnmatch import json import logging import os import shutil import sys import tarfile import tempfile from contextlib import context...
17,927
34.927856
144
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
25,417
45.047101
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/activations.py
import math import torch import torch.nn.functional as F def swish(x): return x * torch.sigmoid(x) def _gelu_python(x): """ Original Implementation of the gelu activation function in Google Bert repo when initially created. For information: OpenAI GPT's gelu is slightly different (and gives slightl...
1,415
26.230769
111
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/__init__.py
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. __version__ = "2.5.1" # Work around to update TensorFlow's absl.logging threshold which alters the # default Python logging output behavior when pre...
14,253
31.692661
113
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
56,253
47.286695
181
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_bert_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2,139
33.516129
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_distilbert.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
39,379
45.93683
169
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_bert_pytorch_checkpoint_to_original_tf.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
4,115
35.424779
118
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
40,975
42.315011
151
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_xlnet_original_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
3,685
31.052174
117
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_albert.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
45,495
44.678715
148
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_xlnet.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
79,322
46.020154
304
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_camembert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
4,797
39.319328
127
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_xlm.py
# coding=utf-8 # Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
48,488
45.489933
197
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_tf_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
30,002
49.172241
472
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
24,643
44.053016
177
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/tokenization_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
28,550
36.175781
204
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_transfo_xl_utilities.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
13,157
40.377358
132
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/convert_pytorch_checkpoint_to_tf2.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
17,316
33.56487
126
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/modeling_roberta.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
32,164
45.081662
149
py
VecConstNMT
VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/tokenization_utils.py
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
92,958
47.265317
372
py