Commit
·
7d4d5d1
1
Parent(s):
55413d4
update
Browse files- __pycache__/model.cpython-313.pyc +0 -0
- config.json/config.json +0 -3
- config.json/model.py +21 -0
- model.py +1 -1
- pytorch_model.bin/model.py +21 -0
- pytorch_model.bin/model.safetensors +1 -1
__pycache__/model.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/model.cpython-313.pyc and b/__pycache__/model.cpython-313.pyc differ
|
|
|
config.json/config.json
CHANGED
|
@@ -1,7 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"auto_map": {
|
| 3 |
-
"AutoConfig": "model.TestConfig"
|
| 4 |
-
},
|
| 5 |
"input_dim": 4,
|
| 6 |
"model_type": "test-model",
|
| 7 |
"output_dim": 16,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
| 2 |
"input_dim": 4,
|
| 3 |
"model_type": "test-model",
|
| 4 |
"output_dim": 16,
|
config.json/model.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PreTrainedModel, PretrainedConfig
|
| 2 |
+
from torch import nn
|
| 3 |
+
|
| 4 |
+
class TestConfig(PretrainedConfig):
|
| 5 |
+
model_type = "test-model"
|
| 6 |
+
|
| 7 |
+
def __init__(self, input_dim=4, output_dim=16, **kwargs):
|
| 8 |
+
super().__init__(**kwargs)
|
| 9 |
+
self.input_dim = input_dim
|
| 10 |
+
self.output_dim = output_dim
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class TestModel(PreTrainedModel):
|
| 14 |
+
config_class = TestConfig
|
| 15 |
+
|
| 16 |
+
def __init__(self, config):
|
| 17 |
+
super().__init__(config)
|
| 18 |
+
self.layer = nn.Linear(config.input_dim, config.output_dim)
|
| 19 |
+
|
| 20 |
+
def forward(self, input):
|
| 21 |
+
return self.layer(input)
|
model.py
CHANGED
|
@@ -5,9 +5,9 @@ class TestConfig(PretrainedConfig):
|
|
| 5 |
model_type = "test-model"
|
| 6 |
|
| 7 |
def __init__(self, input_dim=4, output_dim=16, **kwargs):
|
| 8 |
-
super().__init__(**kwargs)
|
| 9 |
self.input_dim = input_dim
|
| 10 |
self.output_dim = output_dim
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
class TestModel(PreTrainedModel):
|
|
|
|
| 5 |
model_type = "test-model"
|
| 6 |
|
| 7 |
def __init__(self, input_dim=4, output_dim=16, **kwargs):
|
|
|
|
| 8 |
self.input_dim = input_dim
|
| 9 |
self.output_dim = output_dim
|
| 10 |
+
super().__init__(**kwargs)
|
| 11 |
|
| 12 |
|
| 13 |
class TestModel(PreTrainedModel):
|
pytorch_model.bin/model.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PreTrainedModel, PretrainedConfig
|
| 2 |
+
from torch import nn
|
| 3 |
+
|
| 4 |
+
class TestConfig(PretrainedConfig):
|
| 5 |
+
model_type = "test-model"
|
| 6 |
+
|
| 7 |
+
def __init__(self, input_dim=4, output_dim=16, **kwargs):
|
| 8 |
+
super().__init__(**kwargs)
|
| 9 |
+
self.input_dim = input_dim
|
| 10 |
+
self.output_dim = output_dim
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class TestModel(PreTrainedModel):
|
| 14 |
+
config_class = TestConfig
|
| 15 |
+
|
| 16 |
+
def __init__(self, config):
|
| 17 |
+
super().__init__(config)
|
| 18 |
+
self.layer = nn.Linear(config.input_dim, config.output_dim)
|
| 19 |
+
|
| 20 |
+
def forward(self, input):
|
| 21 |
+
return self.layer(input)
|
pytorch_model.bin/model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 496
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d70ce77882860863fe8be43f83938f725ebc05732db7d9e06363d74f3dcd4caa
|
| 3 |
size 496
|