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
kg_one2set
kg_one2set-master/pykp/model.py
import torch.nn as nn import pykp.utils.io as io from pykp.decoder.transformer import TransformerSeq2SeqDecoder from pykp.encoder.transformer import TransformerSeq2SeqEncoder from pykp.modules.position_embed import get_sinusoid_encoding_table class Seq2SeqModel(nn.Module): """Container module with an encoder, de...
2,158
46.977778
154
py
kg_one2set
kg_one2set-master/pykp/modules/position_embed.py
import torch import numpy as np def get_sinusoid_encoding_table(n_position, d_hid, padding_idx=None): """ sinusoid的embedding,其中position的表示中,偶数维(0,2,4,...)是sin, 奇数(1,3,5...)是cos :param int n_position: 一共多少个position :param int d_hid: 多少维度,需要为偶数 :param padding_idx: :return: torch.FloatTensor, sha...
971
30.354839
89
py
kg_one2set
kg_one2set-master/pykp/modules/multi_head_attn.py
import torch import torch.nn as nn from pykp.utils.seq2seq_state import TransformerState import torch.nn.functional as F class MultiHeadAttention(nn.Module): """ Attention is all you need """ def __init__(self, d_model: int = 512, n_head: int = 8, dropout: float = 0.0, layer_idx: int = None, ...
4,829
39.25
104
py
kg_one2set
kg_one2set-master/pykp/encoder/transformer.py
""" Implementation of "Attention is All You Need" """ import torch.nn as nn import torch import torch.nn.functional as F import math from pykp.modules.multi_head_attn import MultiHeadAttention class TransformerSeq2SeqEncoderLayer(nn.Module): def __init__(self, d_model: int = 512, n_head: int = 8, dim_ff: int = 20...
4,118
33.325
109
py
kg_one2set
kg_one2set-master/pykp/utils/masked_loss.py
import torch EPS = 1e-8 def masked_cross_entropy(class_dist, target, trg_mask, loss_scales=None, scale_indices=None): """ :param class_dist: [batch_size, trg_seq_len, num_classes] :param target: [batch_size, trg_seq_len] :param trg_mask: [batch_size, trg_seq_len] :return: """ num_classes ...
1,127
35.387097
100
py
kg_one2set
kg_one2set-master/pykp/utils/label_assign.py
import numpy as np import torch from scipy.optimize import linear_sum_assignment def hungarian_assign(decode_dist, target, ignore_indices, random=False): ''' :param decode_dist: (batch_size, max_kp_num, kp_len, vocab_size) :param target: (batch_size, max_kp_num, kp_len) :return: ''' batch_si...
2,416
36.765625
124
py
kg_one2set
kg_one2set-master/pykp/utils/seq2seq_state.py
r""" 每个Decoder都有对应的State用来记录encoder的输出以及Decode的历史记录 """ __all__ = [ 'State', "LSTMState", "TransformerState" ] from typing import Union import torch class State: def __init__(self, encoder_output=None, encoder_mask=None, **kwargs): """ 每个Decoder都有对应的State对象用来承载encoder的输出以及当前时刻之前的dec...
5,286
35.212329
111
py
kg_one2set
kg_one2set-master/pykp/utils/io.py
# -*- coding: utf-8 -*- import logging import numpy as np import torch import torch.utils.data PAD_WORD = '<pad>' UNK_WORD = '<unk>' BOS_WORD = '<bos>' EOS_WORD = '<eos>' SEP_WORD = '<sep>' DIGIT = '<digit>' PEOS_WORD = '<peos>' NULL_WORD = '<null>' class KeyphraseDataset(torch.utils.data.Dataset): def __init__...
15,235
42.407407
117
py
kg_one2set
kg_one2set-master/pykp/decoder/transformer.py
""" Implementation of "Attention is All You Need" """ import torch import torch.nn as nn from pykp.modules.multi_head_attn import MultiHeadAttention from pykp.utils.seq2seq_state import TransformerState import torch.nn.functional as F import math class TransformerSeq2SeqDecoderLayer(nn.Module): def __init__(self...
11,525
40.76087
119
py
kg_one2set
kg_one2set-master/utils/data_loader.py
import logging import torch from torch.utils.data import DataLoader from pykp.utils.io import KeyphraseDataset def load_vocab(opt): # load vocab logging.info("Loading vocab from disk: %s" % opt.vocab) vocab = torch.load(opt.vocab + '/vocab.pt', 'wb') # assign vocab to opt opt.vocab = vocab l...
2,241
35.754098
109
py
kg_one2set
kg_one2set-master/utils/functions.py
import time import random import numpy as np import logging import torch def common_process_opt(opt): if opt.seed > 0: set_seed(opt.seed) return opt def set_seed(seed): torch.manual_seed(seed) np.random.seed(seed) random.seed(seed) torch.random.manual_seed(seed) torch.cuda.manu...
4,187
35.736842
107
py
kg_one2set
kg_one2set-master/inference/evaluate.py
import logging import os import time import torch import pykp.utils.io as io from pykp.utils.masked_loss import masked_cross_entropy from utils.statistics import LossStatistics from utils.string_helper import * from utils.functions import time_since from pykp.utils.label_assign import hungarian_assign def evaluate_lo...
12,416
55.440909
125
py
kg_one2set
kg_one2set-master/inference/set_generator.py
import pykp.utils.io as io import torch EPS = 1e-8 class SetGenerator(object): def __init__(self, model): self.model = model @classmethod def from_opt(cls, model, opt): return cls(model) def inference(self, src, src_lens, src_oov, src_mask, oov_lists, word2idx): """ :...
2,999
48.180328
162
py
kg_one2set
kg_one2set-master/inference/beam.py
import torch from inference.penalties import PenaltyBuilder class Beam: def __init__(self, size, pad, bos, eos, n_best=1, cuda=False, global_scorer=None, min_length=0, stepwise_penalty=False, block_ngram_repeat=0, ...
10,719
42.40081
160
py
kg_one2set
kg_one2set-master/inference/sequence_generator.py
""" Adapted from OpenNMT-py: https://github.com/OpenNMT/OpenNMT-py and seq2seq-keyphrase-pytorch: https://github.com/memray/seq2seq-keyphrase-pytorch """ import torch import pykp.utils.io as io from inference.beam import Beam from inference.beam import GNMTGlobalScorer EPS = 1e-8 class SequenceGenerator(object): ...
9,089
45.85567
154
py
kg_one2set
kg_one2set-master/inference/penalties.py
from __future__ import division import torch class PenaltyBuilder(object): """ Returns the Length and Coverage Penalty function for Beam Search. Args: length_pen (str): option name of length pen cov_pen (str): option name of cov pen """ def __init__(self, cov_pen, length_pen): ...
2,327
27.048193
74
py
bpr
bpr-master/train_reader.py
import time from argparse import ArgumentParser import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.loggers import CometLogger, TensorBoardLogger from pytorch_lightning.trainer import Trainer from bpr.reader import Reader if __name__ == "__main__": paren...
1,941
36.346154
109
py
bpr
bpr-master/evaluate_retriever.py
import argparse import csv import json import logging import multiprocessing import os import tempfile import time import unicodedata from collections import defaultdict from contextlib import closing from typing import List import faiss import joblib import numpy as np import regex from torch.nn.parallel import DataP...
8,178
39.29064
120
py
bpr
bpr-master/evaluate_reader.py
import logging from argparse import ArgumentParser from pytorch_lightning.trainer import Trainer from pytorch_lightning.utilities.distributed import rank_zero_only from bpr.reader import Reader logger = logging.getLogger(__name__) if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("--c...
1,475
35.9
117
py
bpr
bpr-master/train_biencoder.py
from argparse import ArgumentParser import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.loggers import CometLogger, TensorBoardLogger from pytorch_lightning.trainer import Trainer from bpr.biencoder import BiEncoder if __name__ == "__main__": parent_pars...
2,166
39.12963
120
py
bpr
bpr-master/generate_embeddings.py
import argparse import itertools import joblib import numpy as np import torch from tqdm import tqdm from torch.nn.parallel import DataParallel from transformers import AutoTokenizer from bpr.biencoder import BiEncoder from bpr.passage_db import PassageDB if __name__ == "__main__": parser = argparse.ArgumentPar...
2,547
35.927536
101
py
bpr
bpr-master/bpr/reader.py
import functools import operator import random import re import string import unicodedata from argparse import ArgumentParser, Namespace from typing import Dict, List, Tuple, Union import numpy as np import torch import torch.distributed as dist import torch.nn as nn from pytorch_lightning.core import LightningModule ...
21,038
43.76383
132
py
bpr
bpr-master/bpr/retriever.py
import dataclasses from typing import List import numpy as np import torch from tqdm import trange from transformers import AutoTokenizer from .biencoder import BiEncoder from .index import FaissIndex from .passage_db import Passage, PassageDB @dataclasses.dataclass class Candidate: id: int score: float ...
1,822
34.057692
111
py
bpr
bpr-master/bpr/reader_dataset.py
from __future__ import annotations import dataclasses import glob import json import logging import multiprocessing import os import unicodedata from contextlib import closing from multiprocessing.pool import Pool from typing import Dict, Generator, List, Optional, Tuple import joblib import numpy as np import torch ...
10,702
34.795987
117
py
bpr
bpr-master/bpr/biencoder.py
import functools import glob import json import math import random from argparse import ArgumentParser, Namespace from typing import Dict, Iterable, List, Optional, Tuple, Union import torch import torch.distributed as dist import torch.nn.functional as F from pytorch_lightning.core import LightningModule from pytorch...
18,896
45.090244
123
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/BlenderEmotionalSupport.py
#hide # Imports """ Fine-tuning the library models for language modeling on a text file (GPT, GPT-2, BERT, RoBERTa). GPT and GPT-2 are fine-tuned using a causal language modeling (CLM) loss while BERT and RoBERTa are fine-tuned using a masked language modeling (MLM) loss. """ import os os.environ["CUDA_VISIBLE_DEVICE...
45,610
45.16498
279
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
24,890
41.476109
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
32,156
52.416944
153
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/optimization_tf.py
# Copyright 2019 The TensorFlow Authors, The Hugging Face Team. 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 # # Unl...
15,896
44.161932
126
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
17,208
41.808458
146
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/modeling_outputs.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
52,392
63.444034
205
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/dependency_versions_table.py
# THIS FILE HAS BEEN AUTOGENERATED. To update: # 1. modify the `_deps` dict in setup.py # 2. run `make deps_table_update`` deps = { "black": "black>=20.8b1", "cookiecutter": "cookiecutter==1.7.2", "dataclasses": "dataclasses", "datasets": "datasets", "faiss-cpu": "faiss-cpu", "fastapi": "fastapi...
1,795
32.259259
55
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
86,892
47.597875
197
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/testing_utils.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
34,340
31.458412
118
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/training_args_tf.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
12,875
48.906977
137
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/convert_graph_to_onnx.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
18,445
35.74502
121
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/tokenization_utils_base.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...
157,980
46.728399
252
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/convert_tf_hub_seq_to_seq_bert_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...
2,920
31.820225
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer_callback.py
# coding=utf-8 # Copyright 2020-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 ap...
23,124
41.666052
130
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer_pt_utils.py
# coding=utf-8 # Copyright 2020-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 ap...
16,583
41.198473
120
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/activations_tf.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
2,557
30.195122
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/generation_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...
55,164
48.743012
246
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer_tf.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
33,325
42.506527
129
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/training_args.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
30,144
49.920608
142
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer_seq2seq.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
10,504
43.893162
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/generation_utils.py
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team. # Copyright (c) 2020, 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...
125,957
53.621856
201
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/modeling_flax_utils.py
# coding=utf-8 # Copyright 2018 The Google Flax 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 ...
19,280
46.962687
145
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/integrations.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
31,592
40.624506
160
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/file_utils.py
# Copyright 2020 The HuggingFace Team, the AllenNLP library 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 # ...
55,681
36.776119
150
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/activations.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
3,093
30.252525
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
81,507
37.6477
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/generation_beam_search.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 ...
17,340
44.041558
181
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer_utils.py
# coding=utf-8 # Copyright 2020-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 ap...
6,545
29.588785
116
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
72,081
44.13588
167
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/trainer.py
# coding=utf-8 # Copyright 2020-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 ap...
80,690
45.777391
190
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/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...
16,259
33.522293
126
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/generation_logits_process.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 ...
21,966
45.44186
156
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mobilebert/modeling_tf_mobilebert.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...
76,881
40.356643
160
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mobilebert/convert_mobilebert_original_tf_checkpoint_to_pytorch.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
2,193
37.491228
117
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mobilebert/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
4,260
34.806723
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mobilebert/modeling_mobilebert.py
# MIT License # # Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient # # 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 restricti...
64,629
40.270754
168
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/openai/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...
41,308
41.586598
165
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/openai/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...
35,629
41.568698
168
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/openai/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,689
34.866667
118
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/openai/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
3,424
32.910891
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/xlnet/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...
81,122
41.251563
160
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/xlnet/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
3,834
30.694215
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/xlnet/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,724
31.675439
117
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/xlnet/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...
90,126
42.92154
197
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mpnet/modeling_mpnet.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation. # 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 ...
41,294
37.557423
133
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mpnet/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
3,662
30.307692
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/mpnet/modeling_tf_mpnet.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation. # 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 ...
58,221
39.097796
141
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/prophetnet/convert_prophetnet_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...
7,089
43.037267
118
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/prophetnet/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
2,444
32.493151
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/prophetnet/modeling_prophetnet.py
# coding=utf-8 # Copyright 2020 The Microsoft 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 # # Unl...
103,723
48.158294
213
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/retribert/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
2,389
32.661972
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/retribert/modeling_retribert.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...
9,253
42.446009
120
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/bart/modeling_tf_bart.py
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. 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/...
59,812
45.402638
236
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/bart/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...
5,496
37.173611
117
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/bart/modeling_bart.py
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. 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/...
65,705
43.942544
239
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/bart/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
2,873
33.214286
118
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/rag/modeling_rag.py
# coding=utf-8 # Copyright 2020, The RAG 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 # # Unless r...
83,990
52.361499
204
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/rag/retrieval_rag.py
# coding=utf-8 # Copyright 2020, The RAG 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 # # Unless r...
27,817
44.0859
170
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/rag/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
1,955
32.152542
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/rag/configuration_rag.py
# coding=utf-8 # Copyright 2020, The RAG 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 # # Unless r...
8,858
45.626316
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/deberta/tokenization_deberta.py
# coding=utf-8 # Copyright 2020 Microsoft 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 required...
24,334
35.051852
119
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/deberta/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
2,198
31.820896
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/deberta/modeling_deberta.py
# coding=utf-8 # Copyright 2020 Microsoft and the Hugging Face 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...
41,872
38.803232
126
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/longformer/modeling_longformer.py
# coding=utf-8 # Copyright 2020 The Allen Institute for AI team 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...
106,637
47.938963
222
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/longformer/convert_longformer_original_pytorch_lightning_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,020
33.724138
117
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/longformer/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
3,696
34.209524
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/longformer/modeling_tf_longformer.py
# coding=utf-8 # Copyright 2020 The Allen Institute for AI team 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...
123,508
45.051081
327
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/lxmert/modeling_tf_lxmert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, The HuggingFace Inc. team, and the # Lxmert Authors. # 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....
66,232
43.243821
169
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/lxmert/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
3,162
30.949495
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/lxmert/convert_lxmert_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,141
33.548387
117
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/lxmert/modeling_lxmert.py
# coding=utf-8 # Copyright 2018 Hao Tan, Mohit Bansal, and the HuggingFace 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 r...
64,256
43.653926
177
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/dialogpt/convert_dialogpt_original_pytorch_checkpoint_to_pytorch.py
# Copyright 2020 The HuggingFace Team. 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 applicabl...
1,542
31.829787
85
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/squeezebert/modeling_squeezebert.py
# coding=utf-8 # Copyright 2020 The SqueezeBert 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 # # U...
43,285
38.931734
122
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/squeezebert/__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. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
2,923
34.228916
115
py
Emotional-Support-Conversation
Emotional-Support-Conversation-main/codes/src/transformers/models/electra/convert_electra_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,866
34.8375
117
py