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/huggingface/transformers/src/transformers/commands/convert.py | from argparse import ArgumentParser, Namespace
from logging import getLogger
from transformers.commands import BaseTransformersCLICommand
def convert_command_factory(args: Namespace):
"""
Factory function used to convert a model TF 1.0 checkpoint in a PyTorch checkpoint.
:return: ServeCommand
"""
... | 6,406 | 43.186207 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/commands/train.py | import os
from argparse import ArgumentParser, Namespace
from logging import getLogger
from transformers import SingleSentenceClassificationProcessor as Processor
from transformers import TextClassificationPipeline, is_tf_available, is_torch_available
from transformers.commands import BaseTransformersCLICommand
if n... | 5,830 | 39.213793 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/commands/env.py | import platform
from argparse import ArgumentParser
from transformers import __version__ as version
from transformers import is_tf_available, is_torch_available
from transformers.commands import BaseTransformersCLICommand
def info_command_factory(_):
return EnvironmentCommand()
class EnvironmentCommand(BaseTra... | 2,027 | 33.372881 | 105 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/data/processors/squad.py | import json
import logging
import os
from functools import partial
from multiprocessing import Pool, cpu_count
import numpy as np
from tqdm import tqdm
from ...file_utils import is_tf_available, is_torch_available
from ...tokenization_bert import whitespace_tokenize
from .utils import DataProcessor
if is_torch_avai... | 28,152 | 38.210306 | 125 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/src/transformers/data/processors/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... | 14,009 | 38.576271 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/templates/adding_a_new_model/modeling_xxx.py | # coding=utf-8
# Copyright 2018 XXX Authors
#
# 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 agreed ... | 34,835 | 45.262948 | 134 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/templates/adding_a_new_model/convert_xxx_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,107 | 33 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/templates/adding_a_new_model/modeling_tf_xxx.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,208 | 50.04878 | 193 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/templates/adding_a_new_model/tests/test_modeling_xxx.py | # coding=utf-8
# Copyright 2018 XXX Authors.
#
# 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 agreed... | 11,402 | 40.465455 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/templates/adding_a_new_example_script/run_xxx.py | # coding=utf-8
# Copyright 2018 XXX. 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 applicable... | 29,949 | 40.310345 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_distilbert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 10,498 | 40.498024 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_bart.py | # coding=utf-8
# Copyright 2020 Huggingface
#
# 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 agreed ... | 35,998 | 86.588808 | 7,208 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_xlm_roberta.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 2,957 | 41.869565 | 114 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_t5.py | # coding=utf-8
# Copyright 2018 Google 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 requ... | 8,379 | 37.440367 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_tokenization_common.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... | 30,656 | 42.485106 | 129 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_optimization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 6,425 | 41 | 110 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_ctrl.py | # coding=utf-8
# Copyright 2018 Salesforce 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 required by a... | 9,309 | 36.389558 | 114 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_flaubert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 14,315 | 35.427481 | 112 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_tf_distilbert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 9,154 | 39.870536 | 111 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_doc_samples.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... | 5,357 | 40.215385 | 116 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/utils.py | import os
import tempfile
import unittest
from distutils.util import strtobool
from transformers.file_utils import _tf_available, _torch_available
CACHE_DIR = os.path.join(tempfile.gettempdir(), "transformers_test")
SMALL_MODEL_IDENTIFIER = "julien-c/bert-xsmall-dummy"
DUMMY_UNKWOWN_IDENTIFIER = "julien-c/dummy-unk... | 2,874 | 26.380952 | 84 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_tokenization_transfo_xl.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 2,774 | 31.647059 | 106 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_xlnet.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 28,737 | 29.934338 | 113 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_tf_transfo_xl.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 7,897 | 36.609524 | 107 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_activations.py | import unittest
from transformers import is_torch_available
from .utils import require_torch
if is_torch_available():
from transformers.activations import _gelu_python, get_activation, gelu_new
import torch
@require_torch
class TestActivations(unittest.TestCase):
def test_gelu_versions(self):
... | 863 | 28.793103 | 81 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_pipelines.py | import unittest
from typing import Iterable, List, Optional
from transformers import pipeline
from transformers.pipelines import (
FeatureExtractionPipeline,
FillMaskPipeline,
NerPipeline,
Pipeline,
QuestionAnsweringPipeline,
TextClassificationPipeline,
)
from .utils import require_tf, require... | 13,908 | 39.788856 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_tokenization_xlm_roberta.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 2,977 | 25.589286 | 207 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_gpt2.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 16,470 | 38.123515 | 118 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_common.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... | 29,986 | 41.414427 | 133 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_xlm.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 15,701 | 34.285393 | 180 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_tf_common.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... | 16,552 | 41.88342 | 130 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_bert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 20,556 | 39.626482 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_openai.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 9,463 | 37.628571 | 109 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_roberta.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 15,977 | 43.506964 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_transfo_xl.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 17,487 | 28.945205 | 113 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_auto.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 6,899 | 41.857143 | 117 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_tokenization_fast.py | import unittest
import numpy as np
from tests.utils import require_torch
from transformers import (
BertTokenizer,
BertTokenizerFast,
DistilBertTokenizer,
GPT2Tokenizer,
GPT2TokenizerFast,
OpenAIGPTTokenizer,
PreTrainedTokenizer,
RobertaTokenizer,
TransfoXLTokenizer,
is_torch_a... | 26,053 | 47.337662 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/models/huggingface/transformers/tests/test_modeling_albert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 11,425 | 41.007353 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/modules/transformer_sentence_encoder_layer.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 torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.modules import (
TransformerSentenceEncoderLayer
)
fr... | 2,356 | 28.4625 | 84 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/modules/multihead_attention.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 typing import Dict, Optional, Tuple
import torch
import torch.nn.functional as F
from fairseq import utils
from torch import Tensor, nn
... | 12,558 | 39.124601 | 98 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/modules/transformer_sentence_encoder.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 typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.modules import (
Layer... | 1,884 | 28 | 77 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/models/transformer.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 torch.nn as nn
import torch.nn.functional as F
from fairseq.models import (
register_model,
)
from fairseq.models... | 3,642 | 31.238938 | 107 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/models/transformer_lm.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 torch.nn as nn
from fairseq.models import register_model, register_model_architecture
from fairseq.models.transformer_lm import (
... | 3,752 | 41.168539 | 116 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/models/pipeline_parallel_transformer/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.
from fairseq import utils
from fairseq.models import (
BaseFairseqModel,
FairseqDecoder,
FairseqEncoder,
register_model,
r... | 27,099 | 46.294939 | 151 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/models/pipeline_parallel_transformer/layers.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 namedtuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import option... | 21,730 | 38.655109 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/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... | 10,547 | 37.49635 | 122 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/arguments.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 21,044 | 51.744361 | 89 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/learning_rates.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,765 | 41.176991 | 116 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/utils.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 14,607 | 34.980296 | 111 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/generate_samples.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 19,483 | 37.968 | 148 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/gpt2_data_loader.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 8,342 | 38.353774 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/pretrain_gpt2.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 24,545 | 35.044053 | 123 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/pretrain_bert.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 24,089 | 36.233385 | 105 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/configure_data.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 9,079 | 35.612903 | 119 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/evaluate_gpt2.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 21,084 | 35.542461 | 112 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/fp16/fp16util.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 7,681 | 36.473171 | 337 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/fp16/loss_scaler.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 9,776 | 40.079832 | 326 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/fp16/fp16.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 31,717 | 49.346032 | 437 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/scripts/run_gpt2_eval.py | """
example usage:
python scripts/run_gpt2_eval.py \
--model-parallel-size 1 \
--num-layers 12 \
--hidden-size 768 \
--num-attention-heads 12 \
--model-path <gpt2_117_path> \
--data-path <wikitext_tokens_test_path> \
--batch-size 16 \
--cache-dir <cache dir path>
"""
import argparse
import subprocess
p... | 4,317 | 42.18 | 113 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/mappings.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,136 | 28.133803 | 76 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/initialize.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,883 | 34.911765 | 77 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/cross_entropy.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,716 | 41.881818 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/utils.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 2,711 | 37.197183 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/data.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,018 | 33.350427 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/grads.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 3,015 | 39.213333 | 79 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/layers.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 13,448 | 40.12844 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/transformer.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 27,719 | 41.777778 | 118 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/random.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 9,897 | 39.4 | 114 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/test_layers.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 19,272 | 35.364151 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/test_data.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 2,919 | 30.397849 | 79 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/test_cross_entropy.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 3,870 | 33.873874 | 74 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/commons.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 2,619 | 30.566265 | 75 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/test_random.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 6,698 | 31.206731 | 80 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/mpu/tests/test_initialize.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 3,498 | 34.343434 | 78 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/model/modeling.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fil... | 66,897 | 47.371656 | 174 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/model/model.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 3,754 | 40.263736 | 76 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/model/distributed.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 4,895 | 43.108108 | 103 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/model/gpt2_modeling.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 5,941 | 36.607595 | 78 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/lazy_loader.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 6,908 | 34.25 | 94 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/tf_dl.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 5,443 | 43.991736 | 125 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/wordpiece.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... | 15,599 | 38.897698 | 154 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/tokenization.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 35,985 | 39.47919 | 181 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/datasets.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 32,263 | 36.779859 | 204 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/file_utils.py | # This file is provided as is from:
# https://github.com/huggingface/pytorch-pretrained-BERT
# Please refer to their repository for copyright.
"""
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 author... | 8,441 | 32.23622 | 112 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/__init__.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 5,887 | 42.614815 | 146 | py |
VecConstNMT | VecConstNMT-master/fairseq/model_parallel/megatron/data_utils/samplers.py | # coding=utf-8
# Copyright (c) 2019, 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.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 5,761 | 40.157143 | 113 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/bmuf.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 torch
import torch.distributed as dist
from . import FairseqOptimizer
class FairseqBMUF(FairseqOptimizer):
"""
Implements in... | 8,282 | 34.857143 | 90 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/nag.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 torch
from torch.optim.optimizer import Optimizer, required
from . import FairseqOptimizer, register_optimizer
@register_optimizer('... | 3,485 | 32.519231 | 92 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/sgd.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 torch.optim
from . import register_optimizer, LegacyFairseqOptimizer
@register_optimizer('sgd')
class SGD(LegacyFairseqOptimizer):
... | 1,442 | 31.795455 | 92 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/shard.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.
try:
from fairscale.optim import OSS
_has_fairscale = True
except ImportError:
_has_fairscale = False
def shard_(args, optimize... | 1,051 | 29.941176 | 107 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/adamax.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 torch
import torch.optim
from . import register_optimizer, LegacyFairseqOptimizer
@register_optimizer('adamax')
class FairseqAdamax(... | 6,096 | 37.345912 | 93 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/fp16_optimizer.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 itertools import chain
from collections import defaultdict
import torch
from fairseq import optim, utils
from .dynamic_loss_scaler imp... | 17,936 | 37.491416 | 105 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/adam.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 math
import types
import torch
import torch.optim
import torch.distributed as dist
from fairseq.optim import FairseqOp... | 8,383 | 38.92381 | 116 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/adafactor.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 math
import torch
import torch.optim
from . import register_optimizer, LegacyFairseqOptimizer
@register_optimizer('adafactor')
class... | 10,523 | 43.218487 | 105 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/fused_adam.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 types
import torch
def get_fused_adam_class():
"""
Look for the FusedAdam optimizer from apex. We first try to load the
... | 13,372 | 41.72524 | 109 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/adagrad.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 torch.optim
from . import register_optimizer, LegacyFairseqOptimizer
@register_optimizer('adagrad')
class Adagrad(LegacyFairseqOptim... | 1,278 | 30.195122 | 92 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/fairseq_optimizer.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 torch
from fairseq import utils
class FairseqOptimizer(object):
def __init__(self, args):
super().__init__()
se... | 4,839 | 31.483221 | 87 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/adadelta.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 torch.optim
from . import register_optimizer, LegacyFairseqOptimizer
@register_optimizer('adadelta')
class Adadelta(LegacyFairseqOpt... | 1,835 | 37.25 | 105 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/lr_scheduler/inverse_square_root_schedule.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 . import FairseqLRScheduler, register_lr_scheduler
@register_lr_scheduler('inverse_sqrt')
class InverseSquareRootSchedule(FairseqLRSche... | 2,952 | 38.905405 | 97 | py |
VecConstNMT | VecConstNMT-master/fairseq/optim/lr_scheduler/tri_stage_lr_scheduler.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 . import register_lr_scheduler, LegacyFairseqLRScheduler
import math
@register_lr_scheduler('tri_stage')
class TriStageLRSchedule(Legac... | 5,074 | 29.945122 | 87 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.