Upload bge_custom_impl.py with huggingface_hub
Browse files- bge_custom_impl.py +11 -1
bge_custom_impl.py
CHANGED
@@ -7,7 +7,17 @@ import torch.nn as nn
|
|
7 |
from transformers import AutoModel, AutoTokenizer
|
8 |
|
9 |
class ConcatCustomPooling(nn.Module):
|
10 |
-
def __init__(self, model_name_or_path="BAAI/bge-large-en-v1.5",layers=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
super().__init__()
|
12 |
self.layers = layers
|
13 |
self.base_name = model_name_or_path
|
|
|
7 |
from transformers import AutoModel, AutoTokenizer
|
8 |
|
9 |
class ConcatCustomPooling(nn.Module):
|
10 |
+
def __init__(self, model_name_or_path="BAAI/bge-large-en-v1.5",layers=[
|
11 |
+
15,
|
12 |
+
16,
|
13 |
+
17,
|
14 |
+
18,
|
15 |
+
19,
|
16 |
+
20,
|
17 |
+
21,
|
18 |
+
22,
|
19 |
+
23
|
20 |
+
],max_seq_len=512, **kwargs):
|
21 |
super().__init__()
|
22 |
self.layers = layers
|
23 |
self.base_name = model_name_or_path
|