yuewang-sf
commited on
Commit
·
d30877e
1
Parent(s):
9fdee42
Delete modeling_codet5p_matching.py
Browse files- modeling_codet5p_matching.py +0 -28
modeling_codet5p_matching.py
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 Salesforce authors, The EleutherAI, and HuggingFace Teams. All rights reserved.
|
3 |
-
""" PyTorch CodeT5+ matching models.
|
4 |
-
The implementation is based on transformers.models.t5.modeling_t5 by adding a projection layer on T5EncoderModel
|
5 |
-
"""
|
6 |
-
|
7 |
-
from typing import Optional, Tuple, Union
|
8 |
-
import torch
|
9 |
-
from torch import nn
|
10 |
-
import torch.nn.functional as F
|
11 |
-
from transformers import T5ForConditionalGeneration
|
12 |
-
from transformers.modeling_outputs import (
|
13 |
-
BaseModelOutput,
|
14 |
-
)
|
15 |
-
from configuration_codet5p_matching import CodeT5pMatchingConfig
|
16 |
-
|
17 |
-
|
18 |
-
class CodeT5pMatchingModel(T5ForConditionalGeneration):
|
19 |
-
config_class = CodeT5pMatchingConfig
|
20 |
-
|
21 |
-
authorized_missing_keys = [
|
22 |
-
r"encoder.embed_tokens.weight",
|
23 |
-
]
|
24 |
-
|
25 |
-
def __init__(self, config: CodeT5pMatchingConfig):
|
26 |
-
super().__init__(config)
|
27 |
-
self.proj = nn.Linear(config.d_model, config.embed_dim)
|
28 |
-
self.itm_head = nn.Linear(config.d_model, 2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|