Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/model-checkpoint.py +3 -7
- __pycache__/config.cpython-39.pyc +0 -0
- __pycache__/model.cpython-39.pyc +0 -0
- config.json +1 -1
- model.py +3 -7
- model.safetensors +2 -2
.ipynb_checkpoints/model-checkpoint.py
CHANGED
@@ -15,20 +15,16 @@ from .config import LUARConfig
|
|
15 |
from huggingface_hub import PyTorchModelHubMixin
|
16 |
|
17 |
|
18 |
-
class UARScene(
|
19 |
-
nn.Module,
|
20 |
-
PyTorchModelHubMixin,
|
21 |
-
):
|
22 |
"""Defines the SBERT model.
|
23 |
"""
|
24 |
config_class = LUARConfig
|
25 |
|
26 |
def __init__(self, config):
|
27 |
|
28 |
-
super().__init__()
|
29 |
-
self.config = config
|
30 |
self.create_transformer()
|
31 |
-
self.linear = nn.Linear(self.hidden_size,
|
32 |
|
33 |
def attn_fn(self, k, q ,v) :
|
34 |
d_k = q.size(-1)
|
|
|
15 |
from huggingface_hub import PyTorchModelHubMixin
|
16 |
|
17 |
|
18 |
+
class UARScene(PreTrainedModel):
|
|
|
|
|
|
|
19 |
"""Defines the SBERT model.
|
20 |
"""
|
21 |
config_class = LUARConfig
|
22 |
|
23 |
def __init__(self, config):
|
24 |
|
25 |
+
super().__init__(config)
|
|
|
26 |
self.create_transformer()
|
27 |
+
self.linear = nn.Linear(self.hidden_size, config.embedding_size)
|
28 |
|
29 |
def attn_fn(self, k, q ,v) :
|
30 |
d_k = q.size(-1)
|
__pycache__/config.cpython-39.pyc
CHANGED
Binary files a/__pycache__/config.cpython-39.pyc and b/__pycache__/config.cpython-39.pyc differ
|
|
__pycache__/model.cpython-39.pyc
CHANGED
Binary files a/__pycache__/model.cpython-39.pyc and b/__pycache__/model.cpython-39.pyc differ
|
|
config.json
CHANGED
@@ -11,4 +11,4 @@
|
|
11 |
"torch_dtype": "float32",
|
12 |
"transformers_version": "4.45.2",
|
13 |
"use_memory_efficient_attention": false
|
14 |
-
}
|
|
|
11 |
"torch_dtype": "float32",
|
12 |
"transformers_version": "4.45.2",
|
13 |
"use_memory_efficient_attention": false
|
14 |
+
}
|
model.py
CHANGED
@@ -15,20 +15,16 @@ from .config import LUARConfig
|
|
15 |
from huggingface_hub import PyTorchModelHubMixin
|
16 |
|
17 |
|
18 |
-
class UARScene(
|
19 |
-
nn.Module,
|
20 |
-
PyTorchModelHubMixin,
|
21 |
-
):
|
22 |
"""Defines the SBERT model.
|
23 |
"""
|
24 |
config_class = LUARConfig
|
25 |
|
26 |
def __init__(self, config):
|
27 |
|
28 |
-
super().__init__()
|
29 |
-
self.config = config
|
30 |
self.create_transformer()
|
31 |
-
self.linear = nn.Linear(self.hidden_size,
|
32 |
|
33 |
def attn_fn(self, k, q ,v) :
|
34 |
d_k = q.size(-1)
|
|
|
15 |
from huggingface_hub import PyTorchModelHubMixin
|
16 |
|
17 |
|
18 |
+
class UARScene(PreTrainedModel):
|
|
|
|
|
|
|
19 |
"""Defines the SBERT model.
|
20 |
"""
|
21 |
config_class = LUARConfig
|
22 |
|
23 |
def __init__(self, config):
|
24 |
|
25 |
+
super().__init__(config)
|
|
|
26 |
self.create_transformer()
|
27 |
+
self.linear = nn.Linear(self.hidden_size, config.embedding_size)
|
28 |
|
29 |
def attn_fn(self, k, q ,v) :
|
30 |
d_k = q.size(-1)
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:42876ee22d15016c006ebd597cc1626ce5093cfffeb82994797dba7bc38a8f39
|
3 |
+
size 330061440
|