End of training
Browse files- .hydra/config.yaml +20 -0
- .hydra/hydra.yaml +181 -0
- .hydra/overrides.yaml +1 -0
- README.md +71 -0
- config.json +43 -0
- configuration_gpt_neox_measurement_pred.py +12 -0
- configuration_measurement_pred.py +26 -0
- logs/events.out.tfevents.1734405608.gail.ist.berkeley.edu.288375.0 +3 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +306 -0
- modeling_gpt_neox_measurement_pred.py +12 -0
- modeling_measurement_pred.py +104 -0
- sensor_loc_finder.py +17 -0
- sensor_loc_reg.py +10 -0
- sensor_loc_stories.py +46 -0
- sensor_locs_from_token.py +16 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +224 -0
- train.log +1 -0
- training_args.bin +3 -0
.hydra/config.yaml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
dataset_name: redwoodresearch/generated_stories
|
3 |
+
model_type: gpt_neox
|
4 |
+
pretrained_model_name: EleutherAI/pythia-1.4b-deduped
|
5 |
+
max_length: 1536
|
6 |
+
model_config_params:
|
7 |
+
sensor_loc_type: stories
|
8 |
+
sensor_token: null
|
9 |
+
hparams:
|
10 |
+
learning_rate: 2.0e-05
|
11 |
+
weight_decay: 0.02
|
12 |
+
lr_scheduler_type: cosine
|
13 |
+
warmup_steps: 64
|
14 |
+
effective_batch_size: 2
|
15 |
+
num_train_epochs: 2
|
16 |
+
per_device_train_batch_size: 2
|
17 |
+
per_device_eval_batch_size: 1
|
18 |
+
fp16: true
|
19 |
+
dataset_len: 2
|
20 |
+
push_to_hub: true
|
.hydra/hydra.yaml
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: outputs/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: multirun/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
submitit_folder: ${hydra.sweep.dir}/.submitit/%j
|
9 |
+
timeout_min: 1440
|
10 |
+
cpus_per_task: null
|
11 |
+
gpus_per_node: null
|
12 |
+
tasks_per_node: 1
|
13 |
+
mem_gb: 16
|
14 |
+
nodes: 1
|
15 |
+
name: ${hydra.job.name}
|
16 |
+
stderr_to_stdout: false
|
17 |
+
_target_: hydra_plugins.hydra_submitit_launcher.submitit_launcher.SlurmLauncher
|
18 |
+
partition: null
|
19 |
+
qos: high
|
20 |
+
comment: null
|
21 |
+
constraint: null
|
22 |
+
exclude: ddpg.ist.berkeley.edu,dqn.ist.berkeley.edu
|
23 |
+
gres: gpu:A6000:1
|
24 |
+
cpus_per_gpu: null
|
25 |
+
gpus_per_task: null
|
26 |
+
mem_per_gpu: null
|
27 |
+
mem_per_cpu: null
|
28 |
+
account: null
|
29 |
+
signal_delay_s: 120
|
30 |
+
max_num_timeout: 0
|
31 |
+
additional_parameters: {}
|
32 |
+
array_parallelism: 256
|
33 |
+
setup: null
|
34 |
+
sweeper:
|
35 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
36 |
+
max_batch_size: null
|
37 |
+
params: null
|
38 |
+
help:
|
39 |
+
app_name: ${hydra.job.name}
|
40 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
41 |
+
|
42 |
+
'
|
43 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
44 |
+
|
45 |
+
Use --hydra-help to view Hydra specific help
|
46 |
+
|
47 |
+
'
|
48 |
+
template: '${hydra.help.header}
|
49 |
+
|
50 |
+
== Configuration groups ==
|
51 |
+
|
52 |
+
Compose your configuration from those groups (group=option)
|
53 |
+
|
54 |
+
|
55 |
+
$APP_CONFIG_GROUPS
|
56 |
+
|
57 |
+
|
58 |
+
== Config ==
|
59 |
+
|
60 |
+
Override anything in the config (foo.bar=value)
|
61 |
+
|
62 |
+
|
63 |
+
$CONFIG
|
64 |
+
|
65 |
+
|
66 |
+
${hydra.help.footer}
|
67 |
+
|
68 |
+
'
|
69 |
+
hydra_help:
|
70 |
+
template: 'Hydra (${hydra.runtime.version})
|
71 |
+
|
72 |
+
See https://hydra.cc for more info.
|
73 |
+
|
74 |
+
|
75 |
+
== Flags ==
|
76 |
+
|
77 |
+
$FLAGS_HELP
|
78 |
+
|
79 |
+
|
80 |
+
== Configuration groups ==
|
81 |
+
|
82 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
83 |
+
to command line)
|
84 |
+
|
85 |
+
|
86 |
+
$HYDRA_CONFIG_GROUPS
|
87 |
+
|
88 |
+
|
89 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
90 |
+
|
91 |
+
'
|
92 |
+
hydra_help: ???
|
93 |
+
hydra_logging:
|
94 |
+
version: 1
|
95 |
+
formatters:
|
96 |
+
simple:
|
97 |
+
format: '[%(asctime)s][HYDRA] %(message)s'
|
98 |
+
handlers:
|
99 |
+
console:
|
100 |
+
class: logging.StreamHandler
|
101 |
+
formatter: simple
|
102 |
+
stream: ext://sys.stdout
|
103 |
+
root:
|
104 |
+
level: INFO
|
105 |
+
handlers:
|
106 |
+
- console
|
107 |
+
loggers:
|
108 |
+
logging_example:
|
109 |
+
level: DEBUG
|
110 |
+
disable_existing_loggers: false
|
111 |
+
job_logging:
|
112 |
+
version: 1
|
113 |
+
formatters:
|
114 |
+
simple:
|
115 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
116 |
+
handlers:
|
117 |
+
console:
|
118 |
+
class: logging.StreamHandler
|
119 |
+
formatter: simple
|
120 |
+
stream: ext://sys.stdout
|
121 |
+
file:
|
122 |
+
class: logging.FileHandler
|
123 |
+
formatter: simple
|
124 |
+
filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log
|
125 |
+
root:
|
126 |
+
level: INFO
|
127 |
+
handlers:
|
128 |
+
- console
|
129 |
+
- file
|
130 |
+
disable_existing_loggers: false
|
131 |
+
env: {}
|
132 |
+
mode: MULTIRUN
|
133 |
+
searchpath: []
|
134 |
+
callbacks: {}
|
135 |
+
output_subdir: .hydra
|
136 |
+
overrides:
|
137 |
+
hydra:
|
138 |
+
- hydra.mode=MULTIRUN
|
139 |
+
task: []
|
140 |
+
job:
|
141 |
+
name: train
|
142 |
+
chdir: null
|
143 |
+
override_dirname: ''
|
144 |
+
id: '746837'
|
145 |
+
num: 0
|
146 |
+
config_name: pythia_stories_local_test
|
147 |
+
env_set: {}
|
148 |
+
env_copy: []
|
149 |
+
config:
|
150 |
+
override_dirname:
|
151 |
+
kv_sep: '='
|
152 |
+
item_sep: ','
|
153 |
+
exclude_keys: []
|
154 |
+
runtime:
|
155 |
+
version: 1.3.2
|
156 |
+
version_base: '1.1'
|
157 |
+
cwd: /nas/ucb/oliveradk/measurement-pred
|
158 |
+
config_sources:
|
159 |
+
- path: hydra.conf
|
160 |
+
schema: pkg
|
161 |
+
provider: hydra
|
162 |
+
- path: /nas/ucb/oliveradk/measurement-pred/conf
|
163 |
+
schema: file
|
164 |
+
provider: main
|
165 |
+
- path: ''
|
166 |
+
schema: structured
|
167 |
+
provider: schema
|
168 |
+
output_dir: /nas/ucb/oliveradk/measurement-pred/multirun/2024-12-16/19-19-57/0
|
169 |
+
choices:
|
170 |
+
hparams: hparams
|
171 |
+
model: pythia_stories
|
172 |
+
hydra/env: default
|
173 |
+
hydra/callbacks: null
|
174 |
+
hydra/job_logging: default
|
175 |
+
hydra/hydra_logging: default
|
176 |
+
hydra/hydra_help: default
|
177 |
+
hydra/help: default
|
178 |
+
hydra/sweeper: basic
|
179 |
+
hydra/launcher: slurm_chai
|
180 |
+
hydra/output: default
|
181 |
+
verbose: false
|
.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
README.md
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: EleutherAI/pythia-1.4b-deduped
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
metrics:
|
7 |
+
- accuracy
|
8 |
+
model-index:
|
9 |
+
- name: pythia-1.4b-deduped-measurement_pred-generated_stories
|
10 |
+
results: []
|
11 |
+
---
|
12 |
+
|
13 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
14 |
+
should probably proofread and complete it, then remove this comment. -->
|
15 |
+
|
16 |
+
# pythia-1.4b-deduped-measurement_pred-generated_stories
|
17 |
+
|
18 |
+
This model is a fine-tuned version of [EleutherAI/pythia-1.4b-deduped](https://huggingface.co/EleutherAI/pythia-1.4b-deduped) on an unknown dataset.
|
19 |
+
It achieves the following results on the evaluation set:
|
20 |
+
- Loss: 1.6540
|
21 |
+
- Accuracy: 0.625
|
22 |
+
- Accuracy Sensor 0: 1.0
|
23 |
+
- Auroc Sensor 0: 1.0
|
24 |
+
- Accuracy Sensor 1: 0.5
|
25 |
+
- Auroc Sensor 1: 1.0
|
26 |
+
- Accuracy Sensor 2: 0.5
|
27 |
+
- Auroc Sensor 2: 0.0
|
28 |
+
- Accuracy Aggregated: 0.5
|
29 |
+
- Auroc Aggregated: 1.0
|
30 |
+
|
31 |
+
## Model description
|
32 |
+
|
33 |
+
More information needed
|
34 |
+
|
35 |
+
## Intended uses & limitations
|
36 |
+
|
37 |
+
More information needed
|
38 |
+
|
39 |
+
## Training and evaluation data
|
40 |
+
|
41 |
+
More information needed
|
42 |
+
|
43 |
+
## Training procedure
|
44 |
+
|
45 |
+
### Training hyperparameters
|
46 |
+
|
47 |
+
The following hyperparameters were used during training:
|
48 |
+
- learning_rate: 2e-05
|
49 |
+
- train_batch_size: 2
|
50 |
+
- eval_batch_size: 1
|
51 |
+
- seed: 42
|
52 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
53 |
+
- lr_scheduler_type: cosine
|
54 |
+
- lr_scheduler_warmup_steps: 64
|
55 |
+
- num_epochs: 2
|
56 |
+
- mixed_precision_training: Native AMP
|
57 |
+
|
58 |
+
### Training results
|
59 |
+
|
60 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Accuracy Sensor 0 | Auroc Sensor 0 | Accuracy Sensor 1 | Auroc Sensor 1 | Accuracy Sensor 2 | Auroc Sensor 2 | Accuracy Aggregated | Auroc Aggregated |
|
61 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:-----------------:|:--------------:|:-----------------:|:--------------:|:-----------------:|:--------------:|:-------------------:|:----------------:|
|
62 |
+
| No log | 1.0 | 1 | 1.6540 | 0.625 | 1.0 | 1.0 | 0.5 | 1.0 | 0.5 | 0.0 | 0.5 | 1.0 |
|
63 |
+
| No log | 2.0 | 2 | 1.6540 | 0.625 | 1.0 | 1.0 | 0.5 | 1.0 | 0.5 | 0.0 | 0.5 | 1.0 |
|
64 |
+
|
65 |
+
|
66 |
+
### Framework versions
|
67 |
+
|
68 |
+
- Transformers 4.41.0
|
69 |
+
- Pytorch 2.3.0+cu121
|
70 |
+
- Datasets 2.19.1
|
71 |
+
- Tokenizers 0.19.1
|
config.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "EleutherAI/pythia-1.4b-deduped",
|
3 |
+
"aggregate_weight": 0.3,
|
4 |
+
"architectures": [
|
5 |
+
"GPTNeoXMeasurementPredictor"
|
6 |
+
],
|
7 |
+
"attention_bias": true,
|
8 |
+
"attention_dropout": 0.0,
|
9 |
+
"auto_map": {
|
10 |
+
"AutoConfig": "configuration_gpt_neox_measurement_pred.GPTNeoXMeasurementPredictorConfig",
|
11 |
+
"AutoModelForSequenceClassification": "modeling_gpt_neox_measurement_pred.GPTNeoXMeasurementPredictor"
|
12 |
+
},
|
13 |
+
"bos_token_id": 0,
|
14 |
+
"classifier_dropout": 0.1,
|
15 |
+
"emb_dim": 2048,
|
16 |
+
"eos_token_id": 0,
|
17 |
+
"hidden_act": "gelu",
|
18 |
+
"hidden_dropout": 0.0,
|
19 |
+
"hidden_size": 2048,
|
20 |
+
"initializer_range": 0.02,
|
21 |
+
"intermediate_size": 8192,
|
22 |
+
"layer_norm_eps": 1e-05,
|
23 |
+
"max_position_embeddings": 2048,
|
24 |
+
"model_type": "gpt_neox_mp",
|
25 |
+
"n_sensors": 3,
|
26 |
+
"num_attention_heads": 16,
|
27 |
+
"num_hidden_layers": 24,
|
28 |
+
"pad_token_id": 50277,
|
29 |
+
"rope_scaling": null,
|
30 |
+
"rotary_emb_base": 10000,
|
31 |
+
"rotary_pct": 0.25,
|
32 |
+
"sensor_loc_type": "stories",
|
33 |
+
"sensor_token": null,
|
34 |
+
"sensor_token_id": 35991,
|
35 |
+
"sensors_weight": 0.7,
|
36 |
+
"tie_word_embeddings": false,
|
37 |
+
"torch_dtype": "float32",
|
38 |
+
"transformers_version": "4.41.0",
|
39 |
+
"use_aggregated": true,
|
40 |
+
"use_cache": false,
|
41 |
+
"use_parallel_residual": true,
|
42 |
+
"vocab_size": 50304
|
43 |
+
}
|
configuration_gpt_neox_measurement_pred.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.models.gpt_neox import GPTNeoXConfig
|
2 |
+
from .configuration_measurement_pred import MeasurementPredictorConfig
|
3 |
+
|
4 |
+
|
5 |
+
class GPTNeoXMeasurementPredictorConfig(MeasurementPredictorConfig, GPTNeoXConfig):
|
6 |
+
model_type = "gpt_neox_mp"
|
7 |
+
def __init__(self, **kwargs):
|
8 |
+
kwargs["sensor_token_id"] = 35991
|
9 |
+
super().__init__(**kwargs)
|
10 |
+
|
11 |
+
def get_emb_dim(self):
|
12 |
+
return self.hidden_size
|
configuration_measurement_pred.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from abc import abstractmethod
|
2 |
+
from transformers import PretrainedConfig
|
3 |
+
class MeasurementPredictorConfig(PretrainedConfig):
|
4 |
+
|
5 |
+
def __init__(
|
6 |
+
self,
|
7 |
+
sensor_token=" omit",
|
8 |
+
sensor_loc_type="locs_from_token",
|
9 |
+
n_sensors=3,
|
10 |
+
use_aggregated=True,
|
11 |
+
sensors_weight = 0.7,
|
12 |
+
aggregate_weight=0.3,
|
13 |
+
**kwargs
|
14 |
+
):
|
15 |
+
self.sensor_token = sensor_token
|
16 |
+
self.sensor_loc_type = sensor_loc_type
|
17 |
+
self.n_sensors = n_sensors
|
18 |
+
self.use_aggregated = use_aggregated
|
19 |
+
self.sensors_weight = sensors_weight
|
20 |
+
self.aggregate_weight = aggregate_weight
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.emb_dim = self.get_emb_dim()
|
23 |
+
|
24 |
+
@abstractmethod
|
25 |
+
def get_emb_dim(self):
|
26 |
+
raise NotImplementedError
|
logs/events.out.tfevents.1734405608.gail.ist.berkeley.edu.288375.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:07a50e4244bdd6895a93d3e103c9aab519fe36c78fa6c1130a6b4d72b4f30dd1
|
3 |
+
size 7063
|
model-00001-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:82cea52ed23ce1b3bd41992a81c2033e17737b49493fe975379079ab42de6f90
|
3 |
+
size 4978000256
|
model-00002-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:703c8cbe57be1fb1d5dbe85459cda20a235cdb3afded761a85b2ebad49b15567
|
3 |
+
size 268568360
|
model.safetensors.index.json
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 5246533648
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"aggregate_probe.bias": "model-00001-of-00002.safetensors",
|
7 |
+
"aggregate_probe.weight": "model-00001-of-00002.safetensors",
|
8 |
+
"gpt_neox.embed_in.weight": "model-00001-of-00002.safetensors",
|
9 |
+
"gpt_neox.final_layer_norm.bias": "model-00002-of-00002.safetensors",
|
10 |
+
"gpt_neox.final_layer_norm.weight": "model-00002-of-00002.safetensors",
|
11 |
+
"gpt_neox.layers.0.attention.dense.bias": "model-00001-of-00002.safetensors",
|
12 |
+
"gpt_neox.layers.0.attention.dense.weight": "model-00001-of-00002.safetensors",
|
13 |
+
"gpt_neox.layers.0.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
14 |
+
"gpt_neox.layers.0.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
15 |
+
"gpt_neox.layers.0.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
16 |
+
"gpt_neox.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
17 |
+
"gpt_neox.layers.0.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
18 |
+
"gpt_neox.layers.0.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
19 |
+
"gpt_neox.layers.0.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
20 |
+
"gpt_neox.layers.0.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
21 |
+
"gpt_neox.layers.0.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
22 |
+
"gpt_neox.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
23 |
+
"gpt_neox.layers.1.attention.dense.bias": "model-00001-of-00002.safetensors",
|
24 |
+
"gpt_neox.layers.1.attention.dense.weight": "model-00001-of-00002.safetensors",
|
25 |
+
"gpt_neox.layers.1.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
26 |
+
"gpt_neox.layers.1.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
27 |
+
"gpt_neox.layers.1.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
28 |
+
"gpt_neox.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
29 |
+
"gpt_neox.layers.1.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
30 |
+
"gpt_neox.layers.1.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
31 |
+
"gpt_neox.layers.1.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
32 |
+
"gpt_neox.layers.1.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
33 |
+
"gpt_neox.layers.1.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
34 |
+
"gpt_neox.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
35 |
+
"gpt_neox.layers.10.attention.dense.bias": "model-00001-of-00002.safetensors",
|
36 |
+
"gpt_neox.layers.10.attention.dense.weight": "model-00001-of-00002.safetensors",
|
37 |
+
"gpt_neox.layers.10.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
38 |
+
"gpt_neox.layers.10.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
39 |
+
"gpt_neox.layers.10.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
40 |
+
"gpt_neox.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
41 |
+
"gpt_neox.layers.10.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
42 |
+
"gpt_neox.layers.10.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
43 |
+
"gpt_neox.layers.10.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
44 |
+
"gpt_neox.layers.10.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
45 |
+
"gpt_neox.layers.10.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
46 |
+
"gpt_neox.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
47 |
+
"gpt_neox.layers.11.attention.dense.bias": "model-00001-of-00002.safetensors",
|
48 |
+
"gpt_neox.layers.11.attention.dense.weight": "model-00001-of-00002.safetensors",
|
49 |
+
"gpt_neox.layers.11.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
50 |
+
"gpt_neox.layers.11.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
51 |
+
"gpt_neox.layers.11.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
52 |
+
"gpt_neox.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
53 |
+
"gpt_neox.layers.11.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
54 |
+
"gpt_neox.layers.11.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
55 |
+
"gpt_neox.layers.11.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
56 |
+
"gpt_neox.layers.11.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
57 |
+
"gpt_neox.layers.11.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
58 |
+
"gpt_neox.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
59 |
+
"gpt_neox.layers.12.attention.dense.bias": "model-00001-of-00002.safetensors",
|
60 |
+
"gpt_neox.layers.12.attention.dense.weight": "model-00001-of-00002.safetensors",
|
61 |
+
"gpt_neox.layers.12.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
62 |
+
"gpt_neox.layers.12.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
63 |
+
"gpt_neox.layers.12.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
64 |
+
"gpt_neox.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
65 |
+
"gpt_neox.layers.12.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
66 |
+
"gpt_neox.layers.12.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
67 |
+
"gpt_neox.layers.12.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
68 |
+
"gpt_neox.layers.12.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
69 |
+
"gpt_neox.layers.12.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
70 |
+
"gpt_neox.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
71 |
+
"gpt_neox.layers.13.attention.dense.bias": "model-00001-of-00002.safetensors",
|
72 |
+
"gpt_neox.layers.13.attention.dense.weight": "model-00001-of-00002.safetensors",
|
73 |
+
"gpt_neox.layers.13.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
74 |
+
"gpt_neox.layers.13.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
75 |
+
"gpt_neox.layers.13.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
76 |
+
"gpt_neox.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
77 |
+
"gpt_neox.layers.13.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
78 |
+
"gpt_neox.layers.13.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
79 |
+
"gpt_neox.layers.13.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
80 |
+
"gpt_neox.layers.13.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
81 |
+
"gpt_neox.layers.13.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
82 |
+
"gpt_neox.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
83 |
+
"gpt_neox.layers.14.attention.dense.bias": "model-00001-of-00002.safetensors",
|
84 |
+
"gpt_neox.layers.14.attention.dense.weight": "model-00001-of-00002.safetensors",
|
85 |
+
"gpt_neox.layers.14.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
86 |
+
"gpt_neox.layers.14.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
87 |
+
"gpt_neox.layers.14.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
88 |
+
"gpt_neox.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
89 |
+
"gpt_neox.layers.14.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
90 |
+
"gpt_neox.layers.14.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
91 |
+
"gpt_neox.layers.14.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
92 |
+
"gpt_neox.layers.14.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
93 |
+
"gpt_neox.layers.14.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
94 |
+
"gpt_neox.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
95 |
+
"gpt_neox.layers.15.attention.dense.bias": "model-00001-of-00002.safetensors",
|
96 |
+
"gpt_neox.layers.15.attention.dense.weight": "model-00001-of-00002.safetensors",
|
97 |
+
"gpt_neox.layers.15.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
98 |
+
"gpt_neox.layers.15.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
99 |
+
"gpt_neox.layers.15.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
100 |
+
"gpt_neox.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
101 |
+
"gpt_neox.layers.15.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
102 |
+
"gpt_neox.layers.15.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
103 |
+
"gpt_neox.layers.15.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
104 |
+
"gpt_neox.layers.15.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
105 |
+
"gpt_neox.layers.15.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
106 |
+
"gpt_neox.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
107 |
+
"gpt_neox.layers.16.attention.dense.bias": "model-00001-of-00002.safetensors",
|
108 |
+
"gpt_neox.layers.16.attention.dense.weight": "model-00001-of-00002.safetensors",
|
109 |
+
"gpt_neox.layers.16.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
110 |
+
"gpt_neox.layers.16.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
111 |
+
"gpt_neox.layers.16.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
112 |
+
"gpt_neox.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
113 |
+
"gpt_neox.layers.16.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
114 |
+
"gpt_neox.layers.16.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
115 |
+
"gpt_neox.layers.16.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
116 |
+
"gpt_neox.layers.16.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
117 |
+
"gpt_neox.layers.16.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
118 |
+
"gpt_neox.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
119 |
+
"gpt_neox.layers.17.attention.dense.bias": "model-00001-of-00002.safetensors",
|
120 |
+
"gpt_neox.layers.17.attention.dense.weight": "model-00001-of-00002.safetensors",
|
121 |
+
"gpt_neox.layers.17.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
122 |
+
"gpt_neox.layers.17.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
123 |
+
"gpt_neox.layers.17.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
124 |
+
"gpt_neox.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
125 |
+
"gpt_neox.layers.17.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
126 |
+
"gpt_neox.layers.17.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
127 |
+
"gpt_neox.layers.17.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
128 |
+
"gpt_neox.layers.17.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
129 |
+
"gpt_neox.layers.17.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
130 |
+
"gpt_neox.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
131 |
+
"gpt_neox.layers.18.attention.dense.bias": "model-00001-of-00002.safetensors",
|
132 |
+
"gpt_neox.layers.18.attention.dense.weight": "model-00001-of-00002.safetensors",
|
133 |
+
"gpt_neox.layers.18.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
134 |
+
"gpt_neox.layers.18.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
135 |
+
"gpt_neox.layers.18.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
136 |
+
"gpt_neox.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
137 |
+
"gpt_neox.layers.18.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
138 |
+
"gpt_neox.layers.18.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
139 |
+
"gpt_neox.layers.18.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
140 |
+
"gpt_neox.layers.18.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
141 |
+
"gpt_neox.layers.18.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
142 |
+
"gpt_neox.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
143 |
+
"gpt_neox.layers.19.attention.dense.bias": "model-00001-of-00002.safetensors",
|
144 |
+
"gpt_neox.layers.19.attention.dense.weight": "model-00001-of-00002.safetensors",
|
145 |
+
"gpt_neox.layers.19.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
146 |
+
"gpt_neox.layers.19.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
147 |
+
"gpt_neox.layers.19.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
148 |
+
"gpt_neox.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
149 |
+
"gpt_neox.layers.19.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
150 |
+
"gpt_neox.layers.19.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
151 |
+
"gpt_neox.layers.19.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
152 |
+
"gpt_neox.layers.19.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
153 |
+
"gpt_neox.layers.19.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
154 |
+
"gpt_neox.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
155 |
+
"gpt_neox.layers.2.attention.dense.bias": "model-00001-of-00002.safetensors",
|
156 |
+
"gpt_neox.layers.2.attention.dense.weight": "model-00001-of-00002.safetensors",
|
157 |
+
"gpt_neox.layers.2.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
158 |
+
"gpt_neox.layers.2.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
159 |
+
"gpt_neox.layers.2.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
160 |
+
"gpt_neox.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
161 |
+
"gpt_neox.layers.2.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
162 |
+
"gpt_neox.layers.2.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
163 |
+
"gpt_neox.layers.2.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
164 |
+
"gpt_neox.layers.2.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
165 |
+
"gpt_neox.layers.2.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
166 |
+
"gpt_neox.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
167 |
+
"gpt_neox.layers.20.attention.dense.bias": "model-00001-of-00002.safetensors",
|
168 |
+
"gpt_neox.layers.20.attention.dense.weight": "model-00001-of-00002.safetensors",
|
169 |
+
"gpt_neox.layers.20.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
170 |
+
"gpt_neox.layers.20.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
171 |
+
"gpt_neox.layers.20.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
172 |
+
"gpt_neox.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
173 |
+
"gpt_neox.layers.20.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
174 |
+
"gpt_neox.layers.20.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
175 |
+
"gpt_neox.layers.20.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
176 |
+
"gpt_neox.layers.20.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
177 |
+
"gpt_neox.layers.20.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
178 |
+
"gpt_neox.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
179 |
+
"gpt_neox.layers.21.attention.dense.bias": "model-00001-of-00002.safetensors",
|
180 |
+
"gpt_neox.layers.21.attention.dense.weight": "model-00001-of-00002.safetensors",
|
181 |
+
"gpt_neox.layers.21.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
182 |
+
"gpt_neox.layers.21.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
183 |
+
"gpt_neox.layers.21.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
184 |
+
"gpt_neox.layers.21.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
185 |
+
"gpt_neox.layers.21.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
186 |
+
"gpt_neox.layers.21.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
187 |
+
"gpt_neox.layers.21.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
188 |
+
"gpt_neox.layers.21.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
189 |
+
"gpt_neox.layers.21.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
190 |
+
"gpt_neox.layers.21.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
191 |
+
"gpt_neox.layers.22.attention.dense.bias": "model-00001-of-00002.safetensors",
|
192 |
+
"gpt_neox.layers.22.attention.dense.weight": "model-00001-of-00002.safetensors",
|
193 |
+
"gpt_neox.layers.22.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
194 |
+
"gpt_neox.layers.22.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
195 |
+
"gpt_neox.layers.22.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
196 |
+
"gpt_neox.layers.22.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
197 |
+
"gpt_neox.layers.22.mlp.dense_4h_to_h.bias": "model-00002-of-00002.safetensors",
|
198 |
+
"gpt_neox.layers.22.mlp.dense_4h_to_h.weight": "model-00002-of-00002.safetensors",
|
199 |
+
"gpt_neox.layers.22.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
200 |
+
"gpt_neox.layers.22.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
201 |
+
"gpt_neox.layers.22.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
202 |
+
"gpt_neox.layers.22.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
203 |
+
"gpt_neox.layers.23.attention.dense.bias": "model-00002-of-00002.safetensors",
|
204 |
+
"gpt_neox.layers.23.attention.dense.weight": "model-00002-of-00002.safetensors",
|
205 |
+
"gpt_neox.layers.23.attention.query_key_value.bias": "model-00002-of-00002.safetensors",
|
206 |
+
"gpt_neox.layers.23.attention.query_key_value.weight": "model-00002-of-00002.safetensors",
|
207 |
+
"gpt_neox.layers.23.input_layernorm.bias": "model-00002-of-00002.safetensors",
|
208 |
+
"gpt_neox.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
209 |
+
"gpt_neox.layers.23.mlp.dense_4h_to_h.bias": "model-00002-of-00002.safetensors",
|
210 |
+
"gpt_neox.layers.23.mlp.dense_4h_to_h.weight": "model-00002-of-00002.safetensors",
|
211 |
+
"gpt_neox.layers.23.mlp.dense_h_to_4h.bias": "model-00002-of-00002.safetensors",
|
212 |
+
"gpt_neox.layers.23.mlp.dense_h_to_4h.weight": "model-00002-of-00002.safetensors",
|
213 |
+
"gpt_neox.layers.23.post_attention_layernorm.bias": "model-00002-of-00002.safetensors",
|
214 |
+
"gpt_neox.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
215 |
+
"gpt_neox.layers.3.attention.dense.bias": "model-00001-of-00002.safetensors",
|
216 |
+
"gpt_neox.layers.3.attention.dense.weight": "model-00001-of-00002.safetensors",
|
217 |
+
"gpt_neox.layers.3.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
218 |
+
"gpt_neox.layers.3.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
219 |
+
"gpt_neox.layers.3.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
220 |
+
"gpt_neox.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
221 |
+
"gpt_neox.layers.3.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
222 |
+
"gpt_neox.layers.3.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
223 |
+
"gpt_neox.layers.3.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
224 |
+
"gpt_neox.layers.3.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
225 |
+
"gpt_neox.layers.3.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
226 |
+
"gpt_neox.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
227 |
+
"gpt_neox.layers.4.attention.dense.bias": "model-00001-of-00002.safetensors",
|
228 |
+
"gpt_neox.layers.4.attention.dense.weight": "model-00001-of-00002.safetensors",
|
229 |
+
"gpt_neox.layers.4.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
230 |
+
"gpt_neox.layers.4.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
231 |
+
"gpt_neox.layers.4.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
232 |
+
"gpt_neox.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
233 |
+
"gpt_neox.layers.4.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
234 |
+
"gpt_neox.layers.4.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
235 |
+
"gpt_neox.layers.4.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
236 |
+
"gpt_neox.layers.4.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
237 |
+
"gpt_neox.layers.4.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
238 |
+
"gpt_neox.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
239 |
+
"gpt_neox.layers.5.attention.dense.bias": "model-00001-of-00002.safetensors",
|
240 |
+
"gpt_neox.layers.5.attention.dense.weight": "model-00001-of-00002.safetensors",
|
241 |
+
"gpt_neox.layers.5.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
242 |
+
"gpt_neox.layers.5.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
243 |
+
"gpt_neox.layers.5.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
244 |
+
"gpt_neox.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
245 |
+
"gpt_neox.layers.5.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
246 |
+
"gpt_neox.layers.5.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
247 |
+
"gpt_neox.layers.5.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
248 |
+
"gpt_neox.layers.5.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
249 |
+
"gpt_neox.layers.5.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
250 |
+
"gpt_neox.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
251 |
+
"gpt_neox.layers.6.attention.dense.bias": "model-00001-of-00002.safetensors",
|
252 |
+
"gpt_neox.layers.6.attention.dense.weight": "model-00001-of-00002.safetensors",
|
253 |
+
"gpt_neox.layers.6.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
254 |
+
"gpt_neox.layers.6.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
255 |
+
"gpt_neox.layers.6.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
256 |
+
"gpt_neox.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
257 |
+
"gpt_neox.layers.6.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
258 |
+
"gpt_neox.layers.6.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
259 |
+
"gpt_neox.layers.6.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
260 |
+
"gpt_neox.layers.6.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
261 |
+
"gpt_neox.layers.6.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
262 |
+
"gpt_neox.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
263 |
+
"gpt_neox.layers.7.attention.dense.bias": "model-00001-of-00002.safetensors",
|
264 |
+
"gpt_neox.layers.7.attention.dense.weight": "model-00001-of-00002.safetensors",
|
265 |
+
"gpt_neox.layers.7.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
266 |
+
"gpt_neox.layers.7.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
267 |
+
"gpt_neox.layers.7.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
268 |
+
"gpt_neox.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
269 |
+
"gpt_neox.layers.7.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
270 |
+
"gpt_neox.layers.7.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
271 |
+
"gpt_neox.layers.7.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
272 |
+
"gpt_neox.layers.7.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
273 |
+
"gpt_neox.layers.7.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
274 |
+
"gpt_neox.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
275 |
+
"gpt_neox.layers.8.attention.dense.bias": "model-00001-of-00002.safetensors",
|
276 |
+
"gpt_neox.layers.8.attention.dense.weight": "model-00001-of-00002.safetensors",
|
277 |
+
"gpt_neox.layers.8.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
278 |
+
"gpt_neox.layers.8.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
279 |
+
"gpt_neox.layers.8.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
280 |
+
"gpt_neox.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
281 |
+
"gpt_neox.layers.8.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
282 |
+
"gpt_neox.layers.8.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
283 |
+
"gpt_neox.layers.8.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
284 |
+
"gpt_neox.layers.8.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
285 |
+
"gpt_neox.layers.8.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
286 |
+
"gpt_neox.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
287 |
+
"gpt_neox.layers.9.attention.dense.bias": "model-00001-of-00002.safetensors",
|
288 |
+
"gpt_neox.layers.9.attention.dense.weight": "model-00001-of-00002.safetensors",
|
289 |
+
"gpt_neox.layers.9.attention.query_key_value.bias": "model-00001-of-00002.safetensors",
|
290 |
+
"gpt_neox.layers.9.attention.query_key_value.weight": "model-00001-of-00002.safetensors",
|
291 |
+
"gpt_neox.layers.9.input_layernorm.bias": "model-00001-of-00002.safetensors",
|
292 |
+
"gpt_neox.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
293 |
+
"gpt_neox.layers.9.mlp.dense_4h_to_h.bias": "model-00001-of-00002.safetensors",
|
294 |
+
"gpt_neox.layers.9.mlp.dense_4h_to_h.weight": "model-00001-of-00002.safetensors",
|
295 |
+
"gpt_neox.layers.9.mlp.dense_h_to_4h.bias": "model-00001-of-00002.safetensors",
|
296 |
+
"gpt_neox.layers.9.mlp.dense_h_to_4h.weight": "model-00001-of-00002.safetensors",
|
297 |
+
"gpt_neox.layers.9.post_attention_layernorm.bias": "model-00001-of-00002.safetensors",
|
298 |
+
"gpt_neox.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
299 |
+
"sensor_probes.0.bias": "model-00001-of-00002.safetensors",
|
300 |
+
"sensor_probes.0.weight": "model-00001-of-00002.safetensors",
|
301 |
+
"sensor_probes.1.bias": "model-00001-of-00002.safetensors",
|
302 |
+
"sensor_probes.1.weight": "model-00001-of-00002.safetensors",
|
303 |
+
"sensor_probes.2.bias": "model-00001-of-00002.safetensors",
|
304 |
+
"sensor_probes.2.weight": "model-00001-of-00002.safetensors"
|
305 |
+
}
|
306 |
+
}
|
modeling_gpt_neox_measurement_pred.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.models.gpt_neox import GPTNeoXPreTrainedModel, GPTNeoXModel
|
2 |
+
|
3 |
+
from .modeling_measurement_pred import MeasurementPredictorMixin
|
4 |
+
from .configuration_gpt_neox_measurement_pred import GPTNeoXMeasurementPredictorConfig
|
5 |
+
|
6 |
+
class GPTNeoXMeasurementPredictor(GPTNeoXPreTrainedModel, MeasurementPredictorMixin):
|
7 |
+
config_class = GPTNeoXMeasurementPredictorConfig
|
8 |
+
|
9 |
+
def __init__(self, config):
|
10 |
+
super().__init__(config)
|
11 |
+
self.gpt_neox = GPTNeoXModel(config)
|
12 |
+
self.post_init()
|
modeling_measurement_pred.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Optional, Tuple, Union
|
2 |
+
|
3 |
+
import torch
|
4 |
+
from torch.nn import BCEWithLogitsLoss
|
5 |
+
from transformers import PreTrainedModel, PreTrainedTokenizer
|
6 |
+
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
|
7 |
+
from transformers.modeling_outputs import BaseModelOutputWithPast, SequenceClassifierOutputWithPast
|
8 |
+
|
9 |
+
|
10 |
+
from .sensor_loc_reg import SENSOR_LOC_REGISTRY
|
11 |
+
from .sensor_loc_finder import SensorLocFinder
|
12 |
+
|
13 |
+
class MeasurementPredictorMixin(PreTrainedModel):
|
14 |
+
|
15 |
+
def __init__(self, config):
|
16 |
+
super().__init__(config)
|
17 |
+
self.sensor_loc_type = config.sensor_loc_type
|
18 |
+
self.sensor_token = config.sensor_token
|
19 |
+
self.n_sensors = config.n_sensors
|
20 |
+
self.sensor_probes = torch.nn.ModuleList([
|
21 |
+
torch.nn.Linear(config.emb_dim, 1) for _ in range(config.n_sensors)
|
22 |
+
])
|
23 |
+
self.use_aggregated = config.use_aggregated
|
24 |
+
if config.use_aggregated:
|
25 |
+
self.aggregate_probe = torch.nn.Linear(config.emb_dim, 1)
|
26 |
+
self.sensors_weight = config.sensors_weight
|
27 |
+
self.aggregate_weight = config.aggregate_weight
|
28 |
+
|
29 |
+
self.get_sensor_locs: SensorLocFinder = None
|
30 |
+
|
31 |
+
def init_sensor_loc_finder(self, tokenizer: PreTrainedTokenizerBase):
|
32 |
+
self.get_sensor_locs = SENSOR_LOC_REGISTRY[self.sensor_loc_type](
|
33 |
+
tokenizer, sensor_token=self.sensor_token, n_sensors=self.n_sensors
|
34 |
+
)
|
35 |
+
|
36 |
+
def forward(
|
37 |
+
self,
|
38 |
+
input_ids: Optional[torch.LongTensor] = None,
|
39 |
+
past_key_values: Optional[Tuple[Tuple[torch.Tensor]]] = None,
|
40 |
+
attention_mask: Optional[torch.FloatTensor] = None,
|
41 |
+
position_ids: Optional[torch.LongTensor] = None,
|
42 |
+
head_mask: Optional[torch.FloatTensor] = None,
|
43 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
44 |
+
labels: Optional[torch.LongTensor] = None,
|
45 |
+
use_cache: Optional[bool] = None,
|
46 |
+
output_attentions: Optional[bool] = None,
|
47 |
+
output_hidden_states: Optional[bool] = None,
|
48 |
+
return_dict: Optional[bool] = None,
|
49 |
+
) -> Union[Tuple, SequenceClassifierOutputWithPast]:
|
50 |
+
r"""
|
51 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
52 |
+
Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set
|
53 |
+
`labels = input_ids` Indices are selected in `[-100, 0, ..., config.vocab_size]` All labels set to `-100`
|
54 |
+
are ignored (masked), the loss is only computed for labels in `[0, ..., config.vocab_size]`
|
55 |
+
"""
|
56 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
57 |
+
|
58 |
+
base_model_output: BaseModelOutputWithPast = self.base_model(
|
59 |
+
input_ids,
|
60 |
+
past_key_values=past_key_values,
|
61 |
+
attention_mask=attention_mask,
|
62 |
+
position_ids=position_ids,
|
63 |
+
head_mask=head_mask,
|
64 |
+
inputs_embeds=inputs_embeds,
|
65 |
+
use_cache=use_cache,
|
66 |
+
output_attentions=output_attentions,
|
67 |
+
output_hidden_states=output_hidden_states,
|
68 |
+
return_dict=return_dict,
|
69 |
+
)
|
70 |
+
sensor_locs = self.get_sensor_locs(input_ids)
|
71 |
+
sensor_embs = base_model_output.last_hidden_state.gather(
|
72 |
+
1, sensor_locs.unsqueeze(-1).expand(-1, -1, self.config.emb_dim)
|
73 |
+
)
|
74 |
+
assert sensor_embs.shape == (input_ids.shape[0], self.n_sensors, self.config.emb_dim), f"{sensor_embs.shape} != {(input_ids.shape[0], self.n_sensors, self.config.emb_dim)}"
|
75 |
+
sensor_logits = torch.concat([self.sensor_probes[i](sensor_embs[:, i, :])
|
76 |
+
for i in range(self.n_sensors)], dim=-1)
|
77 |
+
logits = sensor_logits
|
78 |
+
|
79 |
+
if self.use_aggregated:
|
80 |
+
last_emb = base_model_output.last_hidden_state[:, -1, :]
|
81 |
+
aggregate_logits = self.aggregate_probe(last_emb)
|
82 |
+
logits = torch.concat([logits, aggregate_logits], dim=-1)
|
83 |
+
|
84 |
+
loss = None
|
85 |
+
if labels is not None:
|
86 |
+
loss_fct = BCEWithLogitsLoss()
|
87 |
+
sensor_loss = loss_fct(sensor_logits, labels[:, :self.n_sensors]) * self.sensors_weight
|
88 |
+
loss = sensor_loss
|
89 |
+
if self.use_aggregated: #TOOD: should be use aggregate
|
90 |
+
aggregate_loss = loss_fct(aggregate_logits, labels[:, -1:]) * self.aggregate_weight
|
91 |
+
loss += aggregate_loss
|
92 |
+
|
93 |
+
if not return_dict:
|
94 |
+
output = (logits, ) + base_model_output[1:]
|
95 |
+
return ((loss,) + output) if loss is not None else output
|
96 |
+
|
97 |
+
return SequenceClassifierOutputWithPast(
|
98 |
+
loss=loss,
|
99 |
+
logits=logits,
|
100 |
+
past_key_values=base_model_output.past_key_values,
|
101 |
+
hidden_states=base_model_output.hidden_states,
|
102 |
+
attentions=base_model_output.attentions,
|
103 |
+
)
|
104 |
+
|
sensor_loc_finder.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from abc import ABC, abstractmethod
|
2 |
+
import torch
|
3 |
+
from transformers import PreTrainedTokenizerBase
|
4 |
+
|
5 |
+
|
6 |
+
class SensorLocFinder(ABC):
|
7 |
+
|
8 |
+
@abstractmethod
|
9 |
+
def __init__(self, tokenizer: PreTrainedTokenizerBase, **kwargs):
|
10 |
+
pass
|
11 |
+
|
12 |
+
@abstractmethod
|
13 |
+
def find_sensor_locs(self, input_ids: torch.Tensor) -> torch.Tensor:
|
14 |
+
pass
|
15 |
+
|
16 |
+
def __call__(self, input_ids: torch.Tensor) -> torch.Tensor:
|
17 |
+
return self.find_sensor_locs(input_ids)
|
sensor_loc_reg.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from enum import Enum
|
2 |
+
|
3 |
+
from .sensor_loc_stories import StoriesSensorLocFinder
|
4 |
+
from .sensor_locs_from_token import SensorLocFinderFromToken
|
5 |
+
|
6 |
+
|
7 |
+
SENSOR_LOC_REGISTRY = {
|
8 |
+
"stories": StoriesSensorLocFinder,
|
9 |
+
"locs_from_token": SensorLocFinderFromToken
|
10 |
+
}
|
sensor_loc_stories.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from transformers import PreTrainedTokenizerBase
|
3 |
+
|
4 |
+
from .sensor_loc_finder import SensorLocFinder
|
5 |
+
|
6 |
+
|
7 |
+
class StoriesSensorLocFinder(SensorLocFinder):
|
8 |
+
|
9 |
+
def __init__(self, tokenizer: PreTrainedTokenizerBase, **kwargs):
|
10 |
+
self.questions_section_toks = tokenizer.encode("## Questions")
|
11 |
+
self.question_mark_tok = tokenizer.encode("?")[0]
|
12 |
+
self.other_question_mark_tok = tokenizer.encode(")?")[0]
|
13 |
+
assert len(self.questions_section_toks) == 2
|
14 |
+
|
15 |
+
def find_sensor_locs(self, input_ids: torch.Tensor) -> torch.Tensor:
|
16 |
+
device = input_ids.device
|
17 |
+
question_mark_locs = self._is_sensor_loc(input_ids)
|
18 |
+
total_locs = torch.cumsum(question_mark_locs, dim=-1)
|
19 |
+
total_overall = total_locs[:, -1]
|
20 |
+
assert (
|
21 |
+
total_overall == 3
|
22 |
+
).all(), "can handle different cases, but assuming this is easiest"
|
23 |
+
eqs = total_locs[:, :, None] == torch.arange(1, 4)[None, None].to(device)
|
24 |
+
locs = torch.where(
|
25 |
+
eqs.any(dim=-2),
|
26 |
+
torch.argmax(eqs.to(torch.uint8), dim=-2),
|
27 |
+
input_ids.shape[-1] - 3,
|
28 |
+
).clamp(max=input_ids.shape[-1] - 3)
|
29 |
+
return locs
|
30 |
+
|
31 |
+
|
32 |
+
def _is_sensor_loc(self, input_ids: torch.Tensor):
|
33 |
+
questions_section_toks = self.questions_section_toks
|
34 |
+
question_mark_tok = self.question_mark_tok
|
35 |
+
other_question_mark_tok = self.other_question_mark_tok
|
36 |
+
eq_question_item = (input_ids[:, :-1] == questions_section_toks[0]) & (
|
37 |
+
input_ids[:, 1:] == questions_section_toks[1]
|
38 |
+
)
|
39 |
+
assert (eq_question_item.sum(dim=-1, dtype=torch.int) == 1).all(), "could relax"
|
40 |
+
|
41 |
+
summed = torch.cumsum(
|
42 |
+
torch.cat([eq_question_item, eq_question_item[:, -1:]], dim=-1), dim=-1
|
43 |
+
)
|
44 |
+
return (summed > 0) & (
|
45 |
+
(input_ids == question_mark_tok) | (input_ids == other_question_mark_tok)
|
46 |
+
)
|
sensor_locs_from_token.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from transformers import PreTrainedTokenizerBase
|
3 |
+
|
4 |
+
from .sensor_loc_finder import SensorLocFinder
|
5 |
+
|
6 |
+
|
7 |
+
class SensorLocFinderFromToken(SensorLocFinder):
|
8 |
+
|
9 |
+
def __init__(self, tokenizer: PreTrainedTokenizerBase, sensor_token: str, n_sensors: int):
|
10 |
+
self.sensor_token_id = tokenizer.encode(sensor_token)[0]
|
11 |
+
self.n_sensors = n_sensors
|
12 |
+
|
13 |
+
def find_sensor_locs(self, input_ids: torch.Tensor) -> torch.Tensor:
|
14 |
+
flat_sensor_token_idxs = (input_ids == self.sensor_token_id).nonzero(as_tuple=True)[1]
|
15 |
+
sensor_token_idxs = flat_sensor_token_idxs.view(-1, self.n_sensors)
|
16 |
+
return sensor_token_idxs
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|endoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<|endoftext|>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": false,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<|endoftext|>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<|padding|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"50254": {
|
23 |
+
"content": " ",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": true,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": false
|
29 |
+
},
|
30 |
+
"50255": {
|
31 |
+
"content": " ",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": true,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": false
|
37 |
+
},
|
38 |
+
"50256": {
|
39 |
+
"content": " ",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": true,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": false
|
45 |
+
},
|
46 |
+
"50257": {
|
47 |
+
"content": " ",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": true,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": false
|
53 |
+
},
|
54 |
+
"50258": {
|
55 |
+
"content": " ",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": true,
|
58 |
+
"rstrip": false,
|
59 |
+
"single_word": false,
|
60 |
+
"special": false
|
61 |
+
},
|
62 |
+
"50259": {
|
63 |
+
"content": " ",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": true,
|
66 |
+
"rstrip": false,
|
67 |
+
"single_word": false,
|
68 |
+
"special": false
|
69 |
+
},
|
70 |
+
"50260": {
|
71 |
+
"content": " ",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": true,
|
74 |
+
"rstrip": false,
|
75 |
+
"single_word": false,
|
76 |
+
"special": false
|
77 |
+
},
|
78 |
+
"50261": {
|
79 |
+
"content": " ",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": true,
|
82 |
+
"rstrip": false,
|
83 |
+
"single_word": false,
|
84 |
+
"special": false
|
85 |
+
},
|
86 |
+
"50262": {
|
87 |
+
"content": " ",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": true,
|
90 |
+
"rstrip": false,
|
91 |
+
"single_word": false,
|
92 |
+
"special": false
|
93 |
+
},
|
94 |
+
"50263": {
|
95 |
+
"content": " ",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": true,
|
98 |
+
"rstrip": false,
|
99 |
+
"single_word": false,
|
100 |
+
"special": false
|
101 |
+
},
|
102 |
+
"50264": {
|
103 |
+
"content": " ",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": true,
|
106 |
+
"rstrip": false,
|
107 |
+
"single_word": false,
|
108 |
+
"special": false
|
109 |
+
},
|
110 |
+
"50265": {
|
111 |
+
"content": " ",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": true,
|
114 |
+
"rstrip": false,
|
115 |
+
"single_word": false,
|
116 |
+
"special": false
|
117 |
+
},
|
118 |
+
"50266": {
|
119 |
+
"content": " ",
|
120 |
+
"lstrip": false,
|
121 |
+
"normalized": true,
|
122 |
+
"rstrip": false,
|
123 |
+
"single_word": false,
|
124 |
+
"special": false
|
125 |
+
},
|
126 |
+
"50267": {
|
127 |
+
"content": " ",
|
128 |
+
"lstrip": false,
|
129 |
+
"normalized": true,
|
130 |
+
"rstrip": false,
|
131 |
+
"single_word": false,
|
132 |
+
"special": false
|
133 |
+
},
|
134 |
+
"50268": {
|
135 |
+
"content": " ",
|
136 |
+
"lstrip": false,
|
137 |
+
"normalized": true,
|
138 |
+
"rstrip": false,
|
139 |
+
"single_word": false,
|
140 |
+
"special": false
|
141 |
+
},
|
142 |
+
"50269": {
|
143 |
+
"content": " ",
|
144 |
+
"lstrip": false,
|
145 |
+
"normalized": true,
|
146 |
+
"rstrip": false,
|
147 |
+
"single_word": false,
|
148 |
+
"special": false
|
149 |
+
},
|
150 |
+
"50270": {
|
151 |
+
"content": " ",
|
152 |
+
"lstrip": false,
|
153 |
+
"normalized": true,
|
154 |
+
"rstrip": false,
|
155 |
+
"single_word": false,
|
156 |
+
"special": false
|
157 |
+
},
|
158 |
+
"50271": {
|
159 |
+
"content": " ",
|
160 |
+
"lstrip": false,
|
161 |
+
"normalized": true,
|
162 |
+
"rstrip": false,
|
163 |
+
"single_word": false,
|
164 |
+
"special": false
|
165 |
+
},
|
166 |
+
"50272": {
|
167 |
+
"content": " ",
|
168 |
+
"lstrip": false,
|
169 |
+
"normalized": true,
|
170 |
+
"rstrip": false,
|
171 |
+
"single_word": false,
|
172 |
+
"special": false
|
173 |
+
},
|
174 |
+
"50273": {
|
175 |
+
"content": " ",
|
176 |
+
"lstrip": false,
|
177 |
+
"normalized": true,
|
178 |
+
"rstrip": false,
|
179 |
+
"single_word": false,
|
180 |
+
"special": false
|
181 |
+
},
|
182 |
+
"50274": {
|
183 |
+
"content": " ",
|
184 |
+
"lstrip": false,
|
185 |
+
"normalized": true,
|
186 |
+
"rstrip": false,
|
187 |
+
"single_word": false,
|
188 |
+
"special": false
|
189 |
+
},
|
190 |
+
"50275": {
|
191 |
+
"content": " ",
|
192 |
+
"lstrip": false,
|
193 |
+
"normalized": true,
|
194 |
+
"rstrip": false,
|
195 |
+
"single_word": false,
|
196 |
+
"special": false
|
197 |
+
},
|
198 |
+
"50276": {
|
199 |
+
"content": " ",
|
200 |
+
"lstrip": false,
|
201 |
+
"normalized": true,
|
202 |
+
"rstrip": false,
|
203 |
+
"single_word": false,
|
204 |
+
"special": false
|
205 |
+
},
|
206 |
+
"50277": {
|
207 |
+
"content": "[PAD]",
|
208 |
+
"lstrip": false,
|
209 |
+
"normalized": false,
|
210 |
+
"rstrip": false,
|
211 |
+
"single_word": false,
|
212 |
+
"special": true
|
213 |
+
}
|
214 |
+
},
|
215 |
+
"bos_token": "<|endoftext|>",
|
216 |
+
"clean_up_tokenization_spaces": true,
|
217 |
+
"eos_token": "<|endoftext|>",
|
218 |
+
"model_max_length": 1000000000000000019884624838656,
|
219 |
+
"pad_token": "[PAD]",
|
220 |
+
"padding_side": "left",
|
221 |
+
"tokenizer_class": "GPTNeoXTokenizer",
|
222 |
+
"truncation_side": "left",
|
223 |
+
"unk_token": "<|endoftext|>"
|
224 |
+
}
|
train.log
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[2024-12-16 19:20:07,423][accelerate.utils.other][WARNING] - Detected kernel version 5.4.0, which is below the recommended minimum of 5.5.0; this can cause the process to hang. It is recommended to upgrade the kernel to the minimum version or higher.
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ccc5f117ab4a216525346209c056ed0fc4ab9b532db00f6b6e118e8d1834990e
|
3 |
+
size 5112
|