update
Browse files- added_tokens.json +13 -0
- all_results.json +8 -0
- config.json +139 -0
- configuration_phi3.py +227 -0
- generation_config.json +11 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +202 -0
- modeling_phi3.py +1570 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +132 -0
- train_results.json +8 -0
- trainer_log.jsonl +365 -0
- trainer_state.json +0 -0
- training_args.bin +3 -0
added_tokens.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|assistant|>": 32001,
|
3 |
+
"<|endoftext|>": 32000,
|
4 |
+
"<|end|>": 32007,
|
5 |
+
"<|placeholder1|>": 32002,
|
6 |
+
"<|placeholder2|>": 32003,
|
7 |
+
"<|placeholder3|>": 32004,
|
8 |
+
"<|placeholder4|>": 32005,
|
9 |
+
"<|placeholder5|>": 32008,
|
10 |
+
"<|placeholder6|>": 32009,
|
11 |
+
"<|system|>": 32006,
|
12 |
+
"<|user|>": 32010
|
13 |
+
}
|
all_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 2.998027613412229,
|
3 |
+
"total_flos": 287426369617920.0,
|
4 |
+
"train_loss": 0.5032803327368017,
|
5 |
+
"train_runtime": 76434.0426,
|
6 |
+
"train_samples_per_second": 1.433,
|
7 |
+
"train_steps_per_second": 0.024
|
8 |
+
}
|
config.json
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "saves/phi3/sto-iter0-v2/checkpoint-1824",
|
3 |
+
"architectures": [
|
4 |
+
"Phi3ForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"auto_map": {
|
9 |
+
"AutoConfig": "configuration_phi3.Phi3Config",
|
10 |
+
"AutoModel": "modeling_phi3.Phi3ForCausalLM",
|
11 |
+
"AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
|
12 |
+
},
|
13 |
+
"bos_token_id": 1,
|
14 |
+
"embd_pdrop": 0.0,
|
15 |
+
"eos_token_id": 32000,
|
16 |
+
"hidden_act": "silu",
|
17 |
+
"hidden_size": 3072,
|
18 |
+
"initializer_range": 0.02,
|
19 |
+
"intermediate_size": 8192,
|
20 |
+
"max_position_embeddings": 131072,
|
21 |
+
"model_type": "phi3",
|
22 |
+
"num_attention_heads": 32,
|
23 |
+
"num_hidden_layers": 32,
|
24 |
+
"num_key_value_heads": 32,
|
25 |
+
"original_max_position_embeddings": 4096,
|
26 |
+
"pad_token_id": 32000,
|
27 |
+
"resid_pdrop": 0.0,
|
28 |
+
"rms_norm_eps": 1e-05,
|
29 |
+
"rope_scaling": {
|
30 |
+
"long_factor": [
|
31 |
+
1.0800000429153442,
|
32 |
+
1.1100000143051147,
|
33 |
+
1.1399999856948853,
|
34 |
+
1.340000033378601,
|
35 |
+
1.5899999141693115,
|
36 |
+
1.600000023841858,
|
37 |
+
1.6200000047683716,
|
38 |
+
2.620000123977661,
|
39 |
+
3.2300000190734863,
|
40 |
+
3.2300000190734863,
|
41 |
+
4.789999961853027,
|
42 |
+
7.400000095367432,
|
43 |
+
7.700000286102295,
|
44 |
+
9.09000015258789,
|
45 |
+
12.199999809265137,
|
46 |
+
17.670000076293945,
|
47 |
+
24.46000099182129,
|
48 |
+
28.57000160217285,
|
49 |
+
30.420001983642578,
|
50 |
+
30.840002059936523,
|
51 |
+
32.590003967285156,
|
52 |
+
32.93000411987305,
|
53 |
+
42.320003509521484,
|
54 |
+
44.96000289916992,
|
55 |
+
50.340003967285156,
|
56 |
+
50.45000457763672,
|
57 |
+
57.55000305175781,
|
58 |
+
57.93000411987305,
|
59 |
+
58.21000289916992,
|
60 |
+
60.1400032043457,
|
61 |
+
62.61000442504883,
|
62 |
+
62.62000274658203,
|
63 |
+
62.71000289916992,
|
64 |
+
63.1400032043457,
|
65 |
+
63.1400032043457,
|
66 |
+
63.77000427246094,
|
67 |
+
63.93000411987305,
|
68 |
+
63.96000289916992,
|
69 |
+
63.970001220703125,
|
70 |
+
64.02999877929688,
|
71 |
+
64.06999969482422,
|
72 |
+
64.08000183105469,
|
73 |
+
64.12000274658203,
|
74 |
+
64.41000366210938,
|
75 |
+
64.4800033569336,
|
76 |
+
64.51000213623047,
|
77 |
+
64.52999877929688,
|
78 |
+
64.83999633789062
|
79 |
+
],
|
80 |
+
"short_factor": [
|
81 |
+
1.0,
|
82 |
+
1.0199999809265137,
|
83 |
+
1.0299999713897705,
|
84 |
+
1.0299999713897705,
|
85 |
+
1.0499999523162842,
|
86 |
+
1.0499999523162842,
|
87 |
+
1.0499999523162842,
|
88 |
+
1.0499999523162842,
|
89 |
+
1.0499999523162842,
|
90 |
+
1.0699999332427979,
|
91 |
+
1.0999999046325684,
|
92 |
+
1.1099998950958252,
|
93 |
+
1.1599998474121094,
|
94 |
+
1.1599998474121094,
|
95 |
+
1.1699998378753662,
|
96 |
+
1.2899998426437378,
|
97 |
+
1.339999794960022,
|
98 |
+
1.679999828338623,
|
99 |
+
1.7899998426437378,
|
100 |
+
1.8199998140335083,
|
101 |
+
1.8499997854232788,
|
102 |
+
1.8799997568130493,
|
103 |
+
1.9099997282028198,
|
104 |
+
1.9399996995925903,
|
105 |
+
1.9899996519088745,
|
106 |
+
2.0199997425079346,
|
107 |
+
2.0199997425079346,
|
108 |
+
2.0199997425079346,
|
109 |
+
2.0199997425079346,
|
110 |
+
2.0199997425079346,
|
111 |
+
2.0199997425079346,
|
112 |
+
2.0299997329711914,
|
113 |
+
2.0299997329711914,
|
114 |
+
2.0299997329711914,
|
115 |
+
2.0299997329711914,
|
116 |
+
2.0299997329711914,
|
117 |
+
2.0299997329711914,
|
118 |
+
2.0299997329711914,
|
119 |
+
2.0299997329711914,
|
120 |
+
2.0299997329711914,
|
121 |
+
2.0799996852874756,
|
122 |
+
2.0899996757507324,
|
123 |
+
2.189999580383301,
|
124 |
+
2.2199995517730713,
|
125 |
+
2.5899994373321533,
|
126 |
+
2.729999542236328,
|
127 |
+
2.749999523162842,
|
128 |
+
2.8399994373321533
|
129 |
+
],
|
130 |
+
"type": "longrope"
|
131 |
+
},
|
132 |
+
"rope_theta": 10000.0,
|
133 |
+
"sliding_window": 262144,
|
134 |
+
"tie_word_embeddings": false,
|
135 |
+
"torch_dtype": "bfloat16",
|
136 |
+
"transformers_version": "4.43.1",
|
137 |
+
"use_cache": false,
|
138 |
+
"vocab_size": 32064
|
139 |
+
}
|
configuration_phi3.py
ADDED
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
""" Phi-3 model configuration"""
|
17 |
+
|
18 |
+
|
19 |
+
from transformers.configuration_utils import PretrainedConfig
|
20 |
+
from transformers.utils import logging
|
21 |
+
|
22 |
+
|
23 |
+
logger = logging.get_logger(__name__)
|
24 |
+
|
25 |
+
PHI3_PRETRAINED_CONFIG_ARCHIVE_MAP = {
|
26 |
+
"microsoft/Phi-3-mini-4k-instruct": "https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/config.json",
|
27 |
+
"microsoft/Phi-3-mini-128k-instruct": "https://huggingface.co/microsoft/Phi-3-mini-128k-instruct/resolve/main/config.json",
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
class Phi3Config(PretrainedConfig):
|
32 |
+
r"""
|
33 |
+
This is the configuration class to store the configuration of a [`Phi3Model`]. It is used to instantiate a Phi-3
|
34 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
35 |
+
defaults will yield a similar configuration to that of the
|
36 |
+
[microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct).
|
37 |
+
|
38 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
39 |
+
documentation from [`PretrainedConfig`] for more information.
|
40 |
+
|
41 |
+
Args:
|
42 |
+
vocab_size (`int`, *optional*, defaults to 32064):
|
43 |
+
Vocabulary size of the Phi-3 model. Defines the number of different tokens that can be represented by the
|
44 |
+
`inputs_ids` passed when calling [`Phi3Model`].
|
45 |
+
hidden_size (`int`, *optional*, defaults to 3072):
|
46 |
+
Dimension of the hidden representations.
|
47 |
+
intermediate_size (`int`, *optional*, defaults to 8192):
|
48 |
+
Dimension of the MLP representations.
|
49 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
50 |
+
Number of hidden layers in the Transformer decoder.
|
51 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
52 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
53 |
+
num_key_value_heads (`int`, *optional*):
|
54 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
55 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
56 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
57 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
58 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
59 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
60 |
+
`num_attention_heads`.
|
61 |
+
resid_pdrop (`float`, *optional*, defaults to 0.0):
|
62 |
+
Dropout probability for mlp outputs.
|
63 |
+
embd_pdrop (`int`, *optional*, defaults to 0.0):
|
64 |
+
The dropout ratio for the embeddings.
|
65 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
66 |
+
The dropout ratio after computing the attention scores.
|
67 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
68 |
+
The non-linear activation function (function or string) in the decoder.
|
69 |
+
max_position_embeddings (`int`, *optional*, defaults to 4096):
|
70 |
+
The maximum sequence length that this model might ever be used with.
|
71 |
+
original_max_position_embeddings (`int`, *optional*, defaults to 4096):
|
72 |
+
The maximum sequence length that this model was trained with. This is used to determine the size of the
|
73 |
+
original RoPE embeddings when using long scaling.
|
74 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
75 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
76 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-05):
|
77 |
+
The epsilon value used for the RMSNorm.
|
78 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
79 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
80 |
+
relevant if `config.is_decoder=True`. Whether to tie weight embeddings or not.
|
81 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
82 |
+
Whether to tie weight embeddings
|
83 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
84 |
+
The base period of the RoPE embeddings.
|
85 |
+
rope_scaling (`dict`, *optional*):
|
86 |
+
The scaling strategy for the RoPE embeddings. If `None`, no scaling is applied. If a dictionary, it must
|
87 |
+
contain the following keys: `type`, `short_factor` and `long_factor`. The `type` must be `longrope` and
|
88 |
+
the `short_factor` and `long_factor` must be lists of numbers with the same length as the hidden size
|
89 |
+
divided by the number of attention heads divided by 2.
|
90 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
91 |
+
The id of the "beginning-of-sequence" token.
|
92 |
+
eos_token_id (`int`, *optional*, defaults to 32000):
|
93 |
+
The id of the "end-of-sequence" token.
|
94 |
+
pad_token_id (`int`, *optional*, defaults to 32000):
|
95 |
+
The id of the padding token.
|
96 |
+
sliding_window (`int`, *optional*):
|
97 |
+
Sliding window attention window size. If `None`, no sliding window is applied.
|
98 |
+
|
99 |
+
Example:
|
100 |
+
|
101 |
+
```python
|
102 |
+
>>> from transformers import Phi3Model, Phi3Config
|
103 |
+
|
104 |
+
>>> # Initializing a Phi-3 style configuration
|
105 |
+
>>> configuration = Phi3Config.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
106 |
+
|
107 |
+
>>> # Initializing a model from the configuration
|
108 |
+
>>> model = Phi3Model(configuration)
|
109 |
+
|
110 |
+
>>> # Accessing the model configuration
|
111 |
+
>>> configuration = model.config
|
112 |
+
```"""
|
113 |
+
|
114 |
+
model_type = "phi3"
|
115 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
116 |
+
|
117 |
+
def __init__(
|
118 |
+
self,
|
119 |
+
vocab_size=32064,
|
120 |
+
hidden_size=3072,
|
121 |
+
intermediate_size=8192,
|
122 |
+
num_hidden_layers=32,
|
123 |
+
num_attention_heads=32,
|
124 |
+
num_key_value_heads=None,
|
125 |
+
resid_pdrop=0.0,
|
126 |
+
embd_pdrop=0.0,
|
127 |
+
attention_dropout=0.0,
|
128 |
+
hidden_act="silu",
|
129 |
+
max_position_embeddings=4096,
|
130 |
+
original_max_position_embeddings=4096,
|
131 |
+
initializer_range=0.02,
|
132 |
+
rms_norm_eps=1e-5,
|
133 |
+
use_cache=True,
|
134 |
+
tie_word_embeddings=False,
|
135 |
+
rope_theta=10000.0,
|
136 |
+
rope_scaling=None,
|
137 |
+
bos_token_id=1,
|
138 |
+
eos_token_id=32000,
|
139 |
+
pad_token_id=32000,
|
140 |
+
sliding_window=None,
|
141 |
+
**kwargs,
|
142 |
+
):
|
143 |
+
self.vocab_size = vocab_size
|
144 |
+
self.hidden_size = hidden_size
|
145 |
+
self.intermediate_size = intermediate_size
|
146 |
+
self.num_hidden_layers = num_hidden_layers
|
147 |
+
self.num_attention_heads = num_attention_heads
|
148 |
+
|
149 |
+
if num_key_value_heads is None:
|
150 |
+
num_key_value_heads = num_attention_heads
|
151 |
+
|
152 |
+
self.num_key_value_heads = num_key_value_heads
|
153 |
+
self.resid_pdrop = resid_pdrop
|
154 |
+
self.embd_pdrop = embd_pdrop
|
155 |
+
self.attention_dropout = attention_dropout
|
156 |
+
self.hidden_act = hidden_act
|
157 |
+
self.max_position_embeddings = max_position_embeddings
|
158 |
+
self.original_max_position_embeddings = original_max_position_embeddings
|
159 |
+
self.initializer_range = initializer_range
|
160 |
+
self.rms_norm_eps = rms_norm_eps
|
161 |
+
self.use_cache = use_cache
|
162 |
+
self.rope_theta = rope_theta
|
163 |
+
self.rope_scaling = rope_scaling
|
164 |
+
self._rope_scaling_adjustment()
|
165 |
+
self._rope_scaling_validation()
|
166 |
+
self.sliding_window = sliding_window
|
167 |
+
|
168 |
+
super().__init__(
|
169 |
+
bos_token_id=bos_token_id,
|
170 |
+
eos_token_id=eos_token_id,
|
171 |
+
pad_token_id=pad_token_id,
|
172 |
+
tie_word_embeddings=tie_word_embeddings,
|
173 |
+
**kwargs,
|
174 |
+
)
|
175 |
+
|
176 |
+
def _rope_scaling_adjustment(self):
|
177 |
+
"""
|
178 |
+
Adjust the `type` of the `rope_scaling` configuration for backward compatibility.
|
179 |
+
"""
|
180 |
+
if self.rope_scaling is None:
|
181 |
+
return
|
182 |
+
|
183 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
184 |
+
|
185 |
+
# For backward compatibility if previous version used "su" or "yarn"
|
186 |
+
if rope_scaling_type is not None and rope_scaling_type in ["su", "yarn"]:
|
187 |
+
self.rope_scaling["type"] = "longrope"
|
188 |
+
|
189 |
+
def _rope_scaling_validation(self):
|
190 |
+
"""
|
191 |
+
Validate the `rope_scaling` configuration.
|
192 |
+
"""
|
193 |
+
if self.rope_scaling is None:
|
194 |
+
return
|
195 |
+
|
196 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 3:
|
197 |
+
raise ValueError(
|
198 |
+
"`rope_scaling` must be a dictionary with three fields, `type`, `short_factor` and `long_factor`, "
|
199 |
+
f"got {self.rope_scaling}"
|
200 |
+
)
|
201 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
202 |
+
rope_scaling_short_factor = self.rope_scaling.get("short_factor", None)
|
203 |
+
rope_scaling_long_factor = self.rope_scaling.get("long_factor", None)
|
204 |
+
if rope_scaling_type is None or rope_scaling_type not in ["longrope"]:
|
205 |
+
raise ValueError(f"`rope_scaling`'s type field must be one of ['longrope'], got {rope_scaling_type}")
|
206 |
+
if not (
|
207 |
+
isinstance(rope_scaling_short_factor, list)
|
208 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_short_factor)
|
209 |
+
):
|
210 |
+
raise ValueError(
|
211 |
+
f"`rope_scaling`'s short_factor field must be a list of numbers, got {rope_scaling_short_factor}"
|
212 |
+
)
|
213 |
+
if not len(rope_scaling_short_factor) == self.hidden_size // self.num_attention_heads // 2:
|
214 |
+
raise ValueError(
|
215 |
+
f"`rope_scaling`'s short_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_short_factor)}"
|
216 |
+
)
|
217 |
+
if not (
|
218 |
+
isinstance(rope_scaling_long_factor, list)
|
219 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_long_factor)
|
220 |
+
):
|
221 |
+
raise ValueError(
|
222 |
+
f"`rope_scaling`'s long_factor field must be a list of numbers, got {rope_scaling_long_factor}"
|
223 |
+
)
|
224 |
+
if not len(rope_scaling_long_factor) == self.hidden_size // self.num_attention_heads // 2:
|
225 |
+
raise ValueError(
|
226 |
+
f"`rope_scaling`'s long_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_long_factor)}"
|
227 |
+
)
|
generation_config.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": [
|
5 |
+
32007,
|
6 |
+
32001,
|
7 |
+
32000
|
8 |
+
],
|
9 |
+
"pad_token_id": 32000,
|
10 |
+
"transformers_version": "4.43.1"
|
11 |
+
}
|
model-00001-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:01c84eeb3bdd6514eaf54f6d9bdbe390b0ad9837656b6703149e93bea863ad6b
|
3 |
+
size 4972489328
|
model-00002-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5353815e08f408f3cf1b2325a97609677e433b2c0483d9637fd97c325218686c
|
3 |
+
size 2669692552
|
model.safetensors.index.json
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 7642159104
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"lm_head.weight": "model-00002-of-00002.safetensors",
|
7 |
+
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
|
8 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
9 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
10 |
+
"model.layers.0.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
11 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
12 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
13 |
+
"model.layers.0.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
14 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
15 |
+
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
16 |
+
"model.layers.1.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
17 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
18 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
19 |
+
"model.layers.1.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
20 |
+
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
21 |
+
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
22 |
+
"model.layers.10.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
23 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
24 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
25 |
+
"model.layers.10.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
26 |
+
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
27 |
+
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
28 |
+
"model.layers.11.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
29 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
30 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
31 |
+
"model.layers.11.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
32 |
+
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
33 |
+
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
34 |
+
"model.layers.12.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
35 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
36 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
37 |
+
"model.layers.12.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
38 |
+
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
39 |
+
"model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
40 |
+
"model.layers.13.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
41 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
42 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
43 |
+
"model.layers.13.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
44 |
+
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
45 |
+
"model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
46 |
+
"model.layers.14.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
47 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
48 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
49 |
+
"model.layers.14.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
50 |
+
"model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
51 |
+
"model.layers.15.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
52 |
+
"model.layers.15.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
53 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
54 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
55 |
+
"model.layers.15.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
56 |
+
"model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
57 |
+
"model.layers.16.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
58 |
+
"model.layers.16.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
59 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
60 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
61 |
+
"model.layers.16.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
62 |
+
"model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
63 |
+
"model.layers.17.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
64 |
+
"model.layers.17.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
65 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
66 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
67 |
+
"model.layers.17.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
68 |
+
"model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
69 |
+
"model.layers.18.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
70 |
+
"model.layers.18.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
71 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
72 |
+
"model.layers.18.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
73 |
+
"model.layers.18.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
74 |
+
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
75 |
+
"model.layers.19.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
76 |
+
"model.layers.19.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
77 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
78 |
+
"model.layers.19.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
79 |
+
"model.layers.19.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
80 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
81 |
+
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
82 |
+
"model.layers.2.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
83 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
84 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
85 |
+
"model.layers.2.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
86 |
+
"model.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
87 |
+
"model.layers.20.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
88 |
+
"model.layers.20.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
89 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
90 |
+
"model.layers.20.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
91 |
+
"model.layers.20.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
92 |
+
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
93 |
+
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
94 |
+
"model.layers.21.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
95 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
96 |
+
"model.layers.21.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
97 |
+
"model.layers.21.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
98 |
+
"model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
99 |
+
"model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
100 |
+
"model.layers.22.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
101 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
102 |
+
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
103 |
+
"model.layers.22.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
104 |
+
"model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
105 |
+
"model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
106 |
+
"model.layers.23.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
107 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
108 |
+
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
109 |
+
"model.layers.23.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
110 |
+
"model.layers.24.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
111 |
+
"model.layers.24.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
112 |
+
"model.layers.24.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
113 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
114 |
+
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
115 |
+
"model.layers.24.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
116 |
+
"model.layers.25.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
117 |
+
"model.layers.25.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
118 |
+
"model.layers.25.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
119 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
120 |
+
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
121 |
+
"model.layers.25.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
122 |
+
"model.layers.26.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
123 |
+
"model.layers.26.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
124 |
+
"model.layers.26.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
125 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
126 |
+
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
127 |
+
"model.layers.26.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
128 |
+
"model.layers.27.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
129 |
+
"model.layers.27.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
130 |
+
"model.layers.27.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
131 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
132 |
+
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
133 |
+
"model.layers.27.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
134 |
+
"model.layers.28.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
135 |
+
"model.layers.28.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
136 |
+
"model.layers.28.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
137 |
+
"model.layers.28.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
138 |
+
"model.layers.28.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
139 |
+
"model.layers.28.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
140 |
+
"model.layers.29.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
141 |
+
"model.layers.29.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
142 |
+
"model.layers.29.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
143 |
+
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
144 |
+
"model.layers.29.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
145 |
+
"model.layers.29.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
146 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
147 |
+
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
148 |
+
"model.layers.3.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
149 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
150 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
151 |
+
"model.layers.3.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
152 |
+
"model.layers.30.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
153 |
+
"model.layers.30.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
154 |
+
"model.layers.30.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
155 |
+
"model.layers.30.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
156 |
+
"model.layers.30.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
157 |
+
"model.layers.30.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
158 |
+
"model.layers.31.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
159 |
+
"model.layers.31.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
160 |
+
"model.layers.31.mlp.gate_up_proj.weight": "model-00002-of-00002.safetensors",
|
161 |
+
"model.layers.31.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
162 |
+
"model.layers.31.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
163 |
+
"model.layers.31.self_attn.qkv_proj.weight": "model-00002-of-00002.safetensors",
|
164 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
165 |
+
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
166 |
+
"model.layers.4.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
167 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
168 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
169 |
+
"model.layers.4.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
170 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
171 |
+
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
172 |
+
"model.layers.5.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
173 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
174 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
175 |
+
"model.layers.5.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
176 |
+
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
177 |
+
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
178 |
+
"model.layers.6.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
179 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
180 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
181 |
+
"model.layers.6.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
182 |
+
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
183 |
+
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
184 |
+
"model.layers.7.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
185 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
186 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
187 |
+
"model.layers.7.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
188 |
+
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
189 |
+
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
190 |
+
"model.layers.8.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
191 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
192 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
193 |
+
"model.layers.8.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
194 |
+
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
195 |
+
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
196 |
+
"model.layers.9.mlp.gate_up_proj.weight": "model-00001-of-00002.safetensors",
|
197 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
198 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
199 |
+
"model.layers.9.self_attn.qkv_proj.weight": "model-00001-of-00002.safetensors",
|
200 |
+
"model.norm.weight": "model-00002-of-00002.safetensors"
|
201 |
+
}
|
202 |
+
}
|
modeling_phi3.py
ADDED
@@ -0,0 +1,1570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
""" PyTorch Phi-3 model."""
|
17 |
+
|
18 |
+
import inspect
|
19 |
+
import math
|
20 |
+
import warnings
|
21 |
+
from typing import List, Optional, Tuple, Union
|
22 |
+
|
23 |
+
import torch
|
24 |
+
import torch.nn.functional as F
|
25 |
+
import torch.utils.checkpoint
|
26 |
+
from torch import nn
|
27 |
+
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
28 |
+
|
29 |
+
from transformers.activations import ACT2FN
|
30 |
+
from transformers.cache_utils import Cache, DynamicCache
|
31 |
+
from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
|
32 |
+
from transformers.modeling_outputs import (
|
33 |
+
BaseModelOutputWithPast,
|
34 |
+
CausalLMOutputWithPast,
|
35 |
+
SequenceClassifierOutputWithPast,
|
36 |
+
TokenClassifierOutput,
|
37 |
+
)
|
38 |
+
from transformers.modeling_utils import PreTrainedModel
|
39 |
+
from transformers.utils import (
|
40 |
+
add_code_sample_docstrings,
|
41 |
+
add_start_docstrings,
|
42 |
+
add_start_docstrings_to_model_forward,
|
43 |
+
is_flash_attn_2_available,
|
44 |
+
is_flash_attn_greater_or_equal_2_10,
|
45 |
+
logging,
|
46 |
+
replace_return_docstrings,
|
47 |
+
)
|
48 |
+
from .configuration_phi3 import Phi3Config
|
49 |
+
|
50 |
+
|
51 |
+
logger = logging.get_logger(__name__)
|
52 |
+
|
53 |
+
# Transformers scans dependencies in the modeling file, causing issues on conditional loading. The regex only ignores try/catch blocks, but not if statements
|
54 |
+
# if is_flash_attn_2_available():
|
55 |
+
_flash_supports_window_size = False
|
56 |
+
try:
|
57 |
+
from flash_attn import flash_attn_func, flash_attn_varlen_func
|
58 |
+
from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
|
59 |
+
|
60 |
+
_flash_supports_window_size = "window_size" in list(inspect.signature(flash_attn_func).parameters)
|
61 |
+
except ImportError as error:
|
62 |
+
logger.warning(
|
63 |
+
f"`flash-attention` package not found, consider installing for better performance: {error}."
|
64 |
+
)
|
65 |
+
if not _flash_supports_window_size:
|
66 |
+
logger.warning(
|
67 |
+
"Current `flash-attention` does not support `window_size`. Either upgrade or use `attn_implementation='eager'`."
|
68 |
+
)
|
69 |
+
|
70 |
+
_CHECKPOINT_FOR_DOC = "microsoft/Phi-3-mini-4k-instruct"
|
71 |
+
_CONFIG_FOR_DOC = "Phi3Config"
|
72 |
+
|
73 |
+
PHI3_PRETRAINED_MODEL_ARCHIVE_LIST = [
|
74 |
+
"microsoft/Phi-3-mini-4k-instruct",
|
75 |
+
"microsoft/Phi-3-mini-128k-instruct",
|
76 |
+
# See all Phi-3 models at https://huggingface.co/models?filter=Phi-3
|
77 |
+
]
|
78 |
+
|
79 |
+
|
80 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaRMSNorm with Llama->Phi3
|
81 |
+
class Phi3RMSNorm(nn.Module):
|
82 |
+
def __init__(self, hidden_size, eps=1e-6):
|
83 |
+
"""
|
84 |
+
Phi3RMSNorm is equivalent to T5LayerNorm
|
85 |
+
"""
|
86 |
+
super().__init__()
|
87 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
88 |
+
self.variance_epsilon = eps
|
89 |
+
|
90 |
+
def forward(self, hidden_states):
|
91 |
+
input_dtype = hidden_states.dtype
|
92 |
+
hidden_states = hidden_states.to(torch.float32)
|
93 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
94 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
95 |
+
return self.weight * hidden_states.to(input_dtype)
|
96 |
+
|
97 |
+
|
98 |
+
# Copied from transformers.models.llama.modeling_llama._get_unpad_data
|
99 |
+
def _get_unpad_data(attention_mask):
|
100 |
+
seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
|
101 |
+
indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
|
102 |
+
max_seqlen_in_batch = seqlens_in_batch.max().item()
|
103 |
+
cu_seqlens = F.pad(torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.int32), (1, 0))
|
104 |
+
return (
|
105 |
+
indices,
|
106 |
+
cu_seqlens,
|
107 |
+
max_seqlen_in_batch,
|
108 |
+
)
|
109 |
+
|
110 |
+
|
111 |
+
# Copied from transformers.models.gemma.modeling_gemma.GemmaRotaryEmbedding with gemma->phi3, Gemma->Phi3
|
112 |
+
class Phi3RotaryEmbedding(nn.Module):
|
113 |
+
def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None):
|
114 |
+
super().__init__()
|
115 |
+
|
116 |
+
self.dim = dim
|
117 |
+
self.max_position_embeddings = max_position_embeddings
|
118 |
+
self.base = base
|
119 |
+
self.register_buffer("inv_freq", None, persistent=False)
|
120 |
+
|
121 |
+
@torch.no_grad()
|
122 |
+
def forward(self, x, position_ids, seq_len=None):
|
123 |
+
# x: [bs, num_attention_heads, seq_len, head_size]
|
124 |
+
if self.inv_freq is None:
|
125 |
+
self.inv_freq = 1.0 / (
|
126 |
+
self.base ** (torch.arange(0, self.dim, 2, dtype=torch.int64, device=x.device).float() / self.dim)
|
127 |
+
)
|
128 |
+
inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1)
|
129 |
+
position_ids_expanded = position_ids[:, None, :].float()
|
130 |
+
# Force float32 since bfloat16 loses precision on long contexts
|
131 |
+
# See https://github.com/huggingface/transformers/pull/29285
|
132 |
+
device_type = x.device.type
|
133 |
+
device_type = device_type if isinstance(device_type, str) and device_type != "mps" else "cpu"
|
134 |
+
with torch.autocast(device_type=device_type, enabled=False):
|
135 |
+
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
136 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
137 |
+
cos = emb.cos()
|
138 |
+
sin = emb.sin()
|
139 |
+
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
140 |
+
|
141 |
+
|
142 |
+
class Phi3LongRoPEScaledRotaryEmbedding(Phi3RotaryEmbedding):
|
143 |
+
def __init__(self, dim, config, device=None):
|
144 |
+
super().__init__(dim, config.max_position_embeddings, config.rope_theta, device)
|
145 |
+
|
146 |
+
self.short_factor = config.rope_scaling["short_factor"]
|
147 |
+
self.long_factor = config.rope_scaling["long_factor"]
|
148 |
+
self.original_max_position_embeddings = config.original_max_position_embeddings
|
149 |
+
|
150 |
+
@torch.no_grad()
|
151 |
+
def forward(self, x, position_ids, seq_len=None):
|
152 |
+
seq_len = seq_len or torch.max(position_ids) + 1
|
153 |
+
if seq_len > self.original_max_position_embeddings:
|
154 |
+
ext_factors = torch.tensor(self.long_factor, dtype=torch.float32, device=x.device)
|
155 |
+
else:
|
156 |
+
ext_factors = torch.tensor(self.short_factor, dtype=torch.float32, device=x.device)
|
157 |
+
|
158 |
+
inv_freq_shape = torch.arange(0, self.dim, 2, dtype=torch.int64, device=x.device).float() / self.dim
|
159 |
+
self.inv_freq = 1.0 / (ext_factors * self.base**inv_freq_shape)
|
160 |
+
|
161 |
+
inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1)
|
162 |
+
position_ids_expanded = position_ids[:, None, :].float()
|
163 |
+
|
164 |
+
# Force float32 since bfloat16 loses precision on long contexts
|
165 |
+
# See https://github.com/huggingface/transformers/pull/29285
|
166 |
+
device_type = x.device.type
|
167 |
+
device_type = device_type if isinstance(device_type, str) and device_type != "mps" else "cpu"
|
168 |
+
with torch.autocast(device_type=device_type, enabled=False):
|
169 |
+
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
170 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
171 |
+
|
172 |
+
scale = self.max_position_embeddings / self.original_max_position_embeddings
|
173 |
+
if scale <= 1.0:
|
174 |
+
scaling_factor = 1.0
|
175 |
+
else:
|
176 |
+
scaling_factor = math.sqrt(1 + math.log(scale) / math.log(self.original_max_position_embeddings))
|
177 |
+
|
178 |
+
cos = emb.cos() * scaling_factor
|
179 |
+
sin = emb.sin() * scaling_factor
|
180 |
+
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
181 |
+
|
182 |
+
|
183 |
+
# Copied from transformers.models.llama.modeling_llama.rotate_half
|
184 |
+
def rotate_half(x):
|
185 |
+
"""Rotates half the hidden dims of the input."""
|
186 |
+
x1 = x[..., : x.shape[-1] // 2]
|
187 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
188 |
+
return torch.cat((-x2, x1), dim=-1)
|
189 |
+
|
190 |
+
|
191 |
+
# Copied from transformers.models.llama.modeling_llama.apply_rotary_pos_emb
|
192 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
|
193 |
+
"""Applies Rotary Position Embedding to the query and key tensors.
|
194 |
+
|
195 |
+
Args:
|
196 |
+
q (`torch.Tensor`): The query tensor.
|
197 |
+
k (`torch.Tensor`): The key tensor.
|
198 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
199 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
200 |
+
position_ids (`torch.Tensor`, *optional*):
|
201 |
+
Deprecated and unused.
|
202 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
203 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
204 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
205 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
206 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
207 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
208 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
209 |
+
Returns:
|
210 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
211 |
+
"""
|
212 |
+
cos = cos.unsqueeze(unsqueeze_dim)
|
213 |
+
sin = sin.unsqueeze(unsqueeze_dim)
|
214 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
215 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
216 |
+
return q_embed, k_embed
|
217 |
+
|
218 |
+
|
219 |
+
class Phi3MLP(nn.Module):
|
220 |
+
def __init__(self, config):
|
221 |
+
super().__init__()
|
222 |
+
|
223 |
+
self.config = config
|
224 |
+
self.gate_up_proj = nn.Linear(config.hidden_size, 2 * config.intermediate_size, bias=False)
|
225 |
+
self.down_proj = nn.Linear(config.intermediate_size, config.hidden_size, bias=False)
|
226 |
+
|
227 |
+
self.activation_fn = ACT2FN[config.hidden_act]
|
228 |
+
|
229 |
+
def forward(self, hidden_states: torch.FloatTensor) -> torch.FloatTensor:
|
230 |
+
up_states = self.gate_up_proj(hidden_states)
|
231 |
+
|
232 |
+
gate, up_states = up_states.chunk(2, dim=-1)
|
233 |
+
up_states = up_states * self.activation_fn(gate)
|
234 |
+
|
235 |
+
return self.down_proj(up_states)
|
236 |
+
|
237 |
+
|
238 |
+
# Copied from transformers.models.llama.modeling_llama.repeat_kv with llama->phi
|
239 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
240 |
+
"""
|
241 |
+
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
|
242 |
+
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
|
243 |
+
"""
|
244 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
245 |
+
if n_rep == 1:
|
246 |
+
return hidden_states
|
247 |
+
hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
|
248 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
|
249 |
+
|
250 |
+
|
251 |
+
class Phi3Attention(nn.Module):
|
252 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper"""
|
253 |
+
|
254 |
+
def __init__(self, config: Phi3Config, layer_idx: Optional[int] = None):
|
255 |
+
super().__init__()
|
256 |
+
self.config = config
|
257 |
+
self.layer_idx = layer_idx
|
258 |
+
if layer_idx is None:
|
259 |
+
logger.warning_once(
|
260 |
+
f"Instantiating {self.__class__.__name__} without passing a `layer_idx` is not recommended and will "
|
261 |
+
"lead to errors during the forward call if caching is used. Please make sure to provide a `layer_idx` "
|
262 |
+
"when creating this class."
|
263 |
+
)
|
264 |
+
|
265 |
+
self.attention_dropout = config.attention_dropout
|
266 |
+
self.hidden_size = config.hidden_size
|
267 |
+
self.num_heads = config.num_attention_heads
|
268 |
+
self.head_dim = self.hidden_size // self.num_heads
|
269 |
+
self.num_key_value_heads = config.num_key_value_heads
|
270 |
+
self.num_key_value_groups = self.num_heads // self.num_key_value_heads
|
271 |
+
self.max_position_embeddings = config.max_position_embeddings
|
272 |
+
self.original_max_position_embeddings = config.original_max_position_embeddings
|
273 |
+
self.rope_theta = config.rope_theta
|
274 |
+
self.rope_scaling = config.rope_scaling
|
275 |
+
self.is_causal = True
|
276 |
+
|
277 |
+
if (self.head_dim * self.num_heads) != self.hidden_size:
|
278 |
+
raise ValueError(
|
279 |
+
f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
|
280 |
+
f" and `num_heads`: {self.num_heads})."
|
281 |
+
)
|
282 |
+
|
283 |
+
op_size = self.num_heads * self.head_dim + 2 * (self.num_key_value_heads * self.head_dim)
|
284 |
+
self.o_proj = nn.Linear(self.num_heads * self.head_dim, self.hidden_size, bias=False)
|
285 |
+
self.qkv_proj = nn.Linear(self.hidden_size, op_size, bias=False)
|
286 |
+
self._init_rope()
|
287 |
+
|
288 |
+
def _init_rope(self):
|
289 |
+
if self.rope_scaling is None:
|
290 |
+
self.rotary_emb = Phi3RotaryEmbedding(
|
291 |
+
self.head_dim,
|
292 |
+
max_position_embeddings=self.max_position_embeddings,
|
293 |
+
base=self.rope_theta,
|
294 |
+
)
|
295 |
+
else:
|
296 |
+
scaling_type = self.config.rope_scaling["type"]
|
297 |
+
if scaling_type == "longrope":
|
298 |
+
self.rotary_emb = Phi3LongRoPEScaledRotaryEmbedding(self.head_dim, self.config)
|
299 |
+
else:
|
300 |
+
raise ValueError(f"Unknown RoPE scaling type {scaling_type}")
|
301 |
+
|
302 |
+
def forward(
|
303 |
+
self,
|
304 |
+
hidden_states: torch.Tensor,
|
305 |
+
attention_mask: Optional[torch.Tensor] = None,
|
306 |
+
position_ids: Optional[torch.LongTensor] = None,
|
307 |
+
past_key_value: Optional[Cache] = None,
|
308 |
+
output_attentions: bool = False,
|
309 |
+
use_cache: bool = False,
|
310 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
311 |
+
logger.warning_once("You are not running the flash-attention implementation, expect numerical differences.")
|
312 |
+
|
313 |
+
bsz, q_len, _ = hidden_states.size()
|
314 |
+
|
315 |
+
qkv = self.qkv_proj(hidden_states)
|
316 |
+
query_pos = self.num_heads * self.head_dim
|
317 |
+
query_states = qkv[..., :query_pos]
|
318 |
+
key_states = qkv[..., query_pos : query_pos + self.num_key_value_heads * self.head_dim]
|
319 |
+
value_states = qkv[..., query_pos + self.num_key_value_heads * self.head_dim :]
|
320 |
+
|
321 |
+
query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
322 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
323 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
324 |
+
|
325 |
+
kv_seq_len = key_states.shape[-2]
|
326 |
+
if past_key_value is not None:
|
327 |
+
if self.layer_idx is None:
|
328 |
+
raise ValueError(
|
329 |
+
f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
|
330 |
+
"for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
|
331 |
+
"with a layer index."
|
332 |
+
)
|
333 |
+
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
|
334 |
+
cos, sin = self.rotary_emb(value_states, position_ids, seq_len=kv_seq_len)
|
335 |
+
|
336 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
|
337 |
+
|
338 |
+
if past_key_value is not None:
|
339 |
+
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
|
340 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
341 |
+
|
342 |
+
# repeat k/v heads if n_kv_heads < n_heads
|
343 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
344 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
345 |
+
|
346 |
+
attn_weights = torch.matmul(query_states, key_states.transpose(2, 3)) / math.sqrt(self.head_dim)
|
347 |
+
|
348 |
+
if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
|
349 |
+
raise ValueError(
|
350 |
+
f"Attention weights should be of size {(bsz, self.num_heads, q_len, kv_seq_len)}, but is"
|
351 |
+
f" {attn_weights.size()}"
|
352 |
+
)
|
353 |
+
|
354 |
+
if attention_mask is not None:
|
355 |
+
if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
|
356 |
+
raise ValueError(
|
357 |
+
f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
|
358 |
+
)
|
359 |
+
attn_weights = attn_weights + attention_mask
|
360 |
+
|
361 |
+
# upcast attention to fp32
|
362 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(value_states.dtype)
|
363 |
+
attn_weights = nn.functional.dropout(attn_weights, p=self.attention_dropout, training=self.training)
|
364 |
+
|
365 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
366 |
+
|
367 |
+
if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
|
368 |
+
raise ValueError(
|
369 |
+
f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.head_dim)}, but is"
|
370 |
+
f" {attn_output.size()}"
|
371 |
+
)
|
372 |
+
|
373 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
374 |
+
attn_output = attn_output.reshape(bsz, q_len, self.hidden_size)
|
375 |
+
|
376 |
+
attn_output = self.o_proj(attn_output)
|
377 |
+
|
378 |
+
if not output_attentions:
|
379 |
+
attn_weights = None
|
380 |
+
|
381 |
+
return attn_output, attn_weights, past_key_value
|
382 |
+
|
383 |
+
|
384 |
+
class Phi3FlashAttention2(Phi3Attention):
|
385 |
+
"""
|
386 |
+
Phi-3 flash attention module. This module inherits from `Phi3Attention` as the weights of the module stays
|
387 |
+
untouched. The only required change would be on the forward pass where it needs to correctly call the public API of
|
388 |
+
flash attention and deal with padding tokens in case the input contains any of them.
|
389 |
+
"""
|
390 |
+
|
391 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaFlashAttention2.__init__
|
392 |
+
def __init__(self, *args, **kwargs):
|
393 |
+
super().__init__(*args, **kwargs)
|
394 |
+
|
395 |
+
# TODO: Should be removed once Flash Attention for RoCm is bumped to 2.1.
|
396 |
+
# flash_attn<2.1 generates top-left aligned causal mask, while what is needed here is bottom-right alignement, that was made default for flash_attn>=2.1. This attribute is used to handle this difference. Reference: https://github.com/Dao-AILab/flash-attention/releases/tag/v2.1.0.
|
397 |
+
# Beware that with flash_attn<2.1, using q_seqlen != k_seqlen (except for the case q_seqlen == 1) produces a wrong mask (top-left).
|
398 |
+
self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
|
399 |
+
|
400 |
+
def forward(
|
401 |
+
self,
|
402 |
+
hidden_states: torch.Tensor,
|
403 |
+
attention_mask: Optional[torch.LongTensor] = None,
|
404 |
+
position_ids: Optional[torch.LongTensor] = None,
|
405 |
+
past_key_value: Optional[Cache] = None,
|
406 |
+
output_attentions: bool = False,
|
407 |
+
use_cache: bool = False,
|
408 |
+
**kwargs,
|
409 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
410 |
+
# Phi3FlashAttention2 attention does not support output_attentions
|
411 |
+
|
412 |
+
if not _flash_supports_window_size:
|
413 |
+
logger.warning_once(
|
414 |
+
"The current flash attention version does not support sliding window attention. Please use `attn_implementation='eager'` or upgrade flash-attn library."
|
415 |
+
)
|
416 |
+
raise ValueError("The current flash attention version does not support sliding window attention.")
|
417 |
+
|
418 |
+
output_attentions = False
|
419 |
+
|
420 |
+
if "padding_mask" in kwargs:
|
421 |
+
warnings.warn(
|
422 |
+
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
|
423 |
+
)
|
424 |
+
|
425 |
+
# overwrite attention_mask with padding_mask
|
426 |
+
attention_mask = kwargs.pop("padding_mask")
|
427 |
+
|
428 |
+
bsz, q_len, _ = hidden_states.size()
|
429 |
+
|
430 |
+
qkv = self.qkv_proj(hidden_states)
|
431 |
+
query_pos = self.num_heads * self.head_dim
|
432 |
+
query_states = qkv[..., :query_pos]
|
433 |
+
key_states = qkv[..., query_pos : query_pos + self.num_key_value_heads * self.head_dim]
|
434 |
+
value_states = qkv[..., query_pos + self.num_key_value_heads * self.head_dim :]
|
435 |
+
|
436 |
+
# Flash attention requires the input to have the shape
|
437 |
+
# batch_size x seq_length x head_dim x hidden_dim
|
438 |
+
# therefore we just need to keep the original shape
|
439 |
+
query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
440 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
441 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
442 |
+
|
443 |
+
kv_seq_len = key_states.shape[-2]
|
444 |
+
if past_key_value is not None:
|
445 |
+
if self.layer_idx is None:
|
446 |
+
raise ValueError(
|
447 |
+
f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
|
448 |
+
"for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
|
449 |
+
"with a layer index."
|
450 |
+
)
|
451 |
+
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
|
452 |
+
|
453 |
+
# Because the input can be padded, the absolute sequence length depends on the max position id.
|
454 |
+
rotary_seq_len = max(kv_seq_len, position_ids[:, -1].max().item() + 1)
|
455 |
+
cos, sin = self.rotary_emb(value_states, position_ids, seq_len=rotary_seq_len)
|
456 |
+
|
457 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
|
458 |
+
|
459 |
+
use_sliding_windows = (
|
460 |
+
_flash_supports_window_size
|
461 |
+
and getattr(self.config, "sliding_window", None) is not None
|
462 |
+
and kv_seq_len > self.config.sliding_window
|
463 |
+
)
|
464 |
+
|
465 |
+
if past_key_value is not None:
|
466 |
+
# Activate slicing cache only if the config has a value `sliding_windows` attribute
|
467 |
+
cache_has_contents = past_key_value.get_seq_length(self.layer_idx) > 0
|
468 |
+
if (
|
469 |
+
getattr(self.config, "sliding_window", None) is not None
|
470 |
+
and kv_seq_len > self.config.sliding_window
|
471 |
+
and cache_has_contents
|
472 |
+
):
|
473 |
+
slicing_tokens = 1 - self.config.sliding_window
|
474 |
+
|
475 |
+
past_key = past_key_value[self.layer_idx][0]
|
476 |
+
past_value = past_key_value[self.layer_idx][1]
|
477 |
+
|
478 |
+
past_key = past_key[:, :, slicing_tokens:, :].contiguous()
|
479 |
+
past_value = past_value[:, :, slicing_tokens:, :].contiguous()
|
480 |
+
|
481 |
+
if past_key.shape[-2] != self.config.sliding_window - 1:
|
482 |
+
raise ValueError(
|
483 |
+
f"past key must have a shape of (`batch_size, num_heads, self.config.sliding_window-1, head_dim`), got"
|
484 |
+
f" {past_key.shape}"
|
485 |
+
)
|
486 |
+
|
487 |
+
if attention_mask is not None:
|
488 |
+
attention_mask = attention_mask[:, slicing_tokens:]
|
489 |
+
attention_mask = torch.cat([attention_mask, torch.ones_like(attention_mask[:, -1:])], dim=-1)
|
490 |
+
|
491 |
+
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
|
492 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
493 |
+
|
494 |
+
# repeat k/v heads if n_kv_heads < n_heads
|
495 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
496 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
497 |
+
|
498 |
+
attn_dropout = self.attention_dropout if self.training else 0.0
|
499 |
+
|
500 |
+
# In PEFT, usually we cast the layer norms in float32 for training stability reasons
|
501 |
+
# therefore the input hidden states gets silently casted in float32. Hence, we need
|
502 |
+
# cast them back in the correct dtype just to be sure everything works as expected.
|
503 |
+
# This might slowdown training & inference so it is recommended to not cast the LayerNorms
|
504 |
+
# in fp32.
|
505 |
+
|
506 |
+
if query_states.dtype == torch.float32:
|
507 |
+
if torch.is_autocast_enabled():
|
508 |
+
target_dtype = torch.get_autocast_gpu_dtype()
|
509 |
+
# Handle the case where the model is quantized
|
510 |
+
elif hasattr(self.config, "_pre_quantization_dtype"):
|
511 |
+
target_dtype = self.config._pre_quantization_dtype
|
512 |
+
else:
|
513 |
+
target_dtype = self.qkv_proj.weight.dtype
|
514 |
+
|
515 |
+
logger.warning_once(
|
516 |
+
f"The input hidden states seems to be silently casted in float32, this might be related to"
|
517 |
+
f" the fact you have upcasted embedding or layer norm layers in float32. We will cast back the input in"
|
518 |
+
f" {target_dtype}."
|
519 |
+
)
|
520 |
+
|
521 |
+
query_states = query_states.to(target_dtype)
|
522 |
+
key_states = key_states.to(target_dtype)
|
523 |
+
value_states = value_states.to(target_dtype)
|
524 |
+
|
525 |
+
# Reashape to the expected shape for Flash Attention
|
526 |
+
query_states = query_states.transpose(1, 2)
|
527 |
+
key_states = key_states.transpose(1, 2)
|
528 |
+
value_states = value_states.transpose(1, 2)
|
529 |
+
|
530 |
+
attn_output = self._flash_attention_forward(
|
531 |
+
query_states,
|
532 |
+
key_states,
|
533 |
+
value_states,
|
534 |
+
attention_mask,
|
535 |
+
q_len,
|
536 |
+
dropout=attn_dropout,
|
537 |
+
use_sliding_windows=use_sliding_windows,
|
538 |
+
)
|
539 |
+
|
540 |
+
attn_output = attn_output.reshape(bsz, q_len, self.hidden_size).contiguous()
|
541 |
+
attn_output = self.o_proj(attn_output)
|
542 |
+
|
543 |
+
if not output_attentions:
|
544 |
+
attn_weights = None
|
545 |
+
|
546 |
+
return attn_output, attn_weights, past_key_value
|
547 |
+
|
548 |
+
# Copied from transformers.models.mistral.modeling_mistral.MistralFlashAttention2._flash_attention_forward
|
549 |
+
def _flash_attention_forward(
|
550 |
+
self,
|
551 |
+
query_states,
|
552 |
+
key_states,
|
553 |
+
value_states,
|
554 |
+
attention_mask,
|
555 |
+
query_length,
|
556 |
+
dropout=0.0,
|
557 |
+
softmax_scale=None,
|
558 |
+
use_sliding_windows=False,
|
559 |
+
):
|
560 |
+
"""
|
561 |
+
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token
|
562 |
+
first unpad the input, then computes the attention scores and pad the final attention scores.
|
563 |
+
|
564 |
+
Args:
|
565 |
+
query_states (`torch.Tensor`):
|
566 |
+
Input query states to be passed to Flash Attention API
|
567 |
+
key_states (`torch.Tensor`):
|
568 |
+
Input key states to be passed to Flash Attention API
|
569 |
+
value_states (`torch.Tensor`):
|
570 |
+
Input value states to be passed to Flash Attention API
|
571 |
+
attention_mask (`torch.Tensor`):
|
572 |
+
The padding mask - corresponds to a tensor of size `(batch_size, seq_len)` where 0 stands for the
|
573 |
+
position of padding tokens and 1 for the position of non-padding tokens.
|
574 |
+
dropout (`float`):
|
575 |
+
Attention dropout
|
576 |
+
softmax_scale (`float`, *optional*):
|
577 |
+
The scaling of QK^T before applying softmax. Default to 1 / sqrt(head_dim)
|
578 |
+
use_sliding_windows (`bool`, *optional*):
|
579 |
+
Whether to activate sliding window attention.
|
580 |
+
"""
|
581 |
+
if not self._flash_attn_uses_top_left_mask:
|
582 |
+
causal = self.is_causal
|
583 |
+
else:
|
584 |
+
# TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in LlamaFlashAttention2 __init__.
|
585 |
+
causal = self.is_causal and query_length != 1
|
586 |
+
|
587 |
+
# Contains at least one padding token in the sequence
|
588 |
+
if attention_mask is not None:
|
589 |
+
batch_size = query_states.shape[0]
|
590 |
+
query_states, key_states, value_states, indices_q, cu_seq_lens, max_seq_lens = self._upad_input(
|
591 |
+
query_states, key_states, value_states, attention_mask, query_length
|
592 |
+
)
|
593 |
+
|
594 |
+
cu_seqlens_q, cu_seqlens_k = cu_seq_lens
|
595 |
+
max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
|
596 |
+
|
597 |
+
if not use_sliding_windows:
|
598 |
+
attn_output_unpad = flash_attn_varlen_func(
|
599 |
+
query_states,
|
600 |
+
key_states,
|
601 |
+
value_states,
|
602 |
+
cu_seqlens_q=cu_seqlens_q,
|
603 |
+
cu_seqlens_k=cu_seqlens_k,
|
604 |
+
max_seqlen_q=max_seqlen_in_batch_q,
|
605 |
+
max_seqlen_k=max_seqlen_in_batch_k,
|
606 |
+
dropout_p=dropout,
|
607 |
+
softmax_scale=softmax_scale,
|
608 |
+
causal=causal,
|
609 |
+
)
|
610 |
+
else:
|
611 |
+
attn_output_unpad = flash_attn_varlen_func(
|
612 |
+
query_states,
|
613 |
+
key_states,
|
614 |
+
value_states,
|
615 |
+
cu_seqlens_q=cu_seqlens_q,
|
616 |
+
cu_seqlens_k=cu_seqlens_k,
|
617 |
+
max_seqlen_q=max_seqlen_in_batch_q,
|
618 |
+
max_seqlen_k=max_seqlen_in_batch_k,
|
619 |
+
dropout_p=dropout,
|
620 |
+
softmax_scale=softmax_scale,
|
621 |
+
causal=causal,
|
622 |
+
window_size=(self.config.sliding_window, self.config.sliding_window),
|
623 |
+
)
|
624 |
+
|
625 |
+
attn_output = pad_input(attn_output_unpad, indices_q, batch_size, query_length)
|
626 |
+
else:
|
627 |
+
if not use_sliding_windows:
|
628 |
+
attn_output = flash_attn_func(
|
629 |
+
query_states,
|
630 |
+
key_states,
|
631 |
+
value_states,
|
632 |
+
dropout,
|
633 |
+
softmax_scale=softmax_scale,
|
634 |
+
causal=causal,
|
635 |
+
)
|
636 |
+
else:
|
637 |
+
attn_output = flash_attn_func(
|
638 |
+
query_states,
|
639 |
+
key_states,
|
640 |
+
value_states,
|
641 |
+
dropout,
|
642 |
+
softmax_scale=softmax_scale,
|
643 |
+
causal=causal,
|
644 |
+
window_size=(self.config.sliding_window, self.config.sliding_window),
|
645 |
+
)
|
646 |
+
|
647 |
+
return attn_output
|
648 |
+
|
649 |
+
# Copied from transformers.models.mistral.modeling_mistral.MistralFlashAttention2._upad_input
|
650 |
+
def _upad_input(self, query_layer, key_layer, value_layer, attention_mask, query_length):
|
651 |
+
batch_size, kv_seq_len, num_heads, head_dim = key_layer.shape
|
652 |
+
|
653 |
+
# On the first iteration we need to properly re-create the padding mask
|
654 |
+
# by slicing it on the proper place
|
655 |
+
if kv_seq_len != attention_mask.shape[-1]:
|
656 |
+
attention_mask_num_tokens = attention_mask.shape[-1]
|
657 |
+
attention_mask = attention_mask[:, attention_mask_num_tokens - kv_seq_len :]
|
658 |
+
|
659 |
+
indices_k, cu_seqlens_k, max_seqlen_in_batch_k = _get_unpad_data(attention_mask)
|
660 |
+
|
661 |
+
key_layer = index_first_axis(key_layer.reshape(batch_size * kv_seq_len, num_heads, head_dim), indices_k)
|
662 |
+
value_layer = index_first_axis(value_layer.reshape(batch_size * kv_seq_len, num_heads, head_dim), indices_k)
|
663 |
+
|
664 |
+
if query_length == kv_seq_len:
|
665 |
+
query_layer = index_first_axis(
|
666 |
+
query_layer.reshape(batch_size * kv_seq_len, num_heads, head_dim), indices_k
|
667 |
+
)
|
668 |
+
cu_seqlens_q = cu_seqlens_k
|
669 |
+
max_seqlen_in_batch_q = max_seqlen_in_batch_k
|
670 |
+
indices_q = indices_k
|
671 |
+
elif query_length == 1:
|
672 |
+
max_seqlen_in_batch_q = 1
|
673 |
+
cu_seqlens_q = torch.arange(
|
674 |
+
batch_size + 1, dtype=torch.int32, device=query_layer.device
|
675 |
+
) # There is a memcpy here, that is very bad.
|
676 |
+
indices_q = cu_seqlens_q[:-1]
|
677 |
+
query_layer = query_layer.squeeze(1)
|
678 |
+
else:
|
679 |
+
# The -q_len: slice assumes left padding.
|
680 |
+
attention_mask = attention_mask[:, -query_length:]
|
681 |
+
query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(query_layer, attention_mask)
|
682 |
+
|
683 |
+
return (
|
684 |
+
query_layer,
|
685 |
+
key_layer,
|
686 |
+
value_layer,
|
687 |
+
indices_q,
|
688 |
+
(cu_seqlens_q, cu_seqlens_k),
|
689 |
+
(max_seqlen_in_batch_q, max_seqlen_in_batch_k),
|
690 |
+
)
|
691 |
+
|
692 |
+
|
693 |
+
# copied from transformers.models.llama.modeling_llama.LlamaSdpaAttention with Llama->Phi3
|
694 |
+
# TODO @Arthur no longer copied from LLama after static cache
|
695 |
+
class Phi3SdpaAttention(Phi3Attention):
|
696 |
+
"""
|
697 |
+
Phi3 attention module using torch.nn.functional.scaled_dot_product_attention. This module inherits from
|
698 |
+
`Phi3Attention` as the weights of the module stays untouched. The only changes are on the forward pass to adapt to
|
699 |
+
SDPA API.
|
700 |
+
"""
|
701 |
+
|
702 |
+
# Adapted from Phi3Attention.forward
|
703 |
+
def forward(
|
704 |
+
self,
|
705 |
+
hidden_states: torch.Tensor,
|
706 |
+
attention_mask: Optional[torch.Tensor] = None,
|
707 |
+
position_ids: Optional[torch.LongTensor] = None,
|
708 |
+
past_key_value: Optional[Cache] = None,
|
709 |
+
output_attentions: bool = False,
|
710 |
+
use_cache: bool = False,
|
711 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
712 |
+
if output_attentions:
|
713 |
+
# TODO: Improve this warning with e.g. `model.config.attn_implementation = "manual"` once this is implemented.
|
714 |
+
logger.warning_once(
|
715 |
+
"Phi3Model is using Phi3SdpaAttention, but `torch.nn.functional.scaled_dot_product_attention` does not support `output_attentions=True`. Falling back to the manual attention implementation, "
|
716 |
+
'but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument `attn_implementation="eager"` when loading the model.'
|
717 |
+
)
|
718 |
+
return super().forward(
|
719 |
+
hidden_states=hidden_states,
|
720 |
+
attention_mask=attention_mask,
|
721 |
+
position_ids=position_ids,
|
722 |
+
past_key_value=past_key_value,
|
723 |
+
output_attentions=output_attentions,
|
724 |
+
use_cache=use_cache,
|
725 |
+
)
|
726 |
+
|
727 |
+
bsz, q_len, _ = hidden_states.size()
|
728 |
+
|
729 |
+
qkv = self.qkv_proj(hidden_states)
|
730 |
+
query_pos = self.num_heads * self.head_dim
|
731 |
+
query_states = qkv[..., :query_pos]
|
732 |
+
key_states = qkv[..., query_pos : query_pos + self.num_key_value_heads * self.head_dim]
|
733 |
+
value_states = qkv[..., query_pos + self.num_key_value_heads * self.head_dim :]
|
734 |
+
|
735 |
+
query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
736 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
737 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
738 |
+
|
739 |
+
kv_seq_len = key_states.shape[-2]
|
740 |
+
if past_key_value is not None:
|
741 |
+
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
|
742 |
+
cos, sin = self.rotary_emb(value_states, position_ids, seq_len=kv_seq_len)
|
743 |
+
|
744 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
|
745 |
+
|
746 |
+
if past_key_value is not None:
|
747 |
+
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
|
748 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
749 |
+
|
750 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
751 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
752 |
+
|
753 |
+
if attention_mask is not None:
|
754 |
+
if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
|
755 |
+
raise ValueError(
|
756 |
+
f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
|
757 |
+
)
|
758 |
+
|
759 |
+
# SDPA with memory-efficient backend is currently (torch==2.1.2) bugged with non-contiguous inputs with custom attn_mask,
|
760 |
+
# Reference: https://github.com/pytorch/pytorch/issues/112577.
|
761 |
+
if query_states.device.type == "cuda" and attention_mask is not None:
|
762 |
+
query_states = query_states.contiguous()
|
763 |
+
key_states = key_states.contiguous()
|
764 |
+
value_states = value_states.contiguous()
|
765 |
+
|
766 |
+
attn_output = torch.nn.functional.scaled_dot_product_attention(
|
767 |
+
query_states,
|
768 |
+
key_states,
|
769 |
+
value_states,
|
770 |
+
attn_mask=attention_mask,
|
771 |
+
dropout_p=self.attention_dropout if self.training else 0.0,
|
772 |
+
# The q_len > 1 is necessary to match with AttentionMaskConverter.to_causal_4d that does not create a causal mask in case q_len == 1.
|
773 |
+
is_causal=self.is_causal and attention_mask is None and q_len > 1,
|
774 |
+
)
|
775 |
+
|
776 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
777 |
+
attn_output = attn_output.view(bsz, q_len, self.hidden_size)
|
778 |
+
|
779 |
+
attn_output = self.o_proj(attn_output)
|
780 |
+
|
781 |
+
return attn_output, None, past_key_value
|
782 |
+
|
783 |
+
|
784 |
+
PHI3_ATTENTION_CLASSES = {
|
785 |
+
"eager": Phi3Attention,
|
786 |
+
"flash_attention_2": Phi3FlashAttention2,
|
787 |
+
"sdpa": Phi3SdpaAttention,
|
788 |
+
}
|
789 |
+
|
790 |
+
|
791 |
+
class Phi3DecoderLayer(nn.Module):
|
792 |
+
def __init__(self, config: Phi3Config, layer_idx: int):
|
793 |
+
super().__init__()
|
794 |
+
|
795 |
+
self.config = config
|
796 |
+
self.self_attn = PHI3_ATTENTION_CLASSES[config._attn_implementation](config, layer_idx=layer_idx)
|
797 |
+
|
798 |
+
self.mlp = Phi3MLP(config)
|
799 |
+
self.input_layernorm = Phi3RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
800 |
+
|
801 |
+
self.resid_attn_dropout = nn.Dropout(config.resid_pdrop)
|
802 |
+
self.resid_mlp_dropout = nn.Dropout(config.resid_pdrop)
|
803 |
+
self.post_attention_layernorm = Phi3RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
804 |
+
|
805 |
+
def forward(
|
806 |
+
self,
|
807 |
+
hidden_states: torch.Tensor,
|
808 |
+
attention_mask: Optional[torch.Tensor] = None,
|
809 |
+
position_ids: Optional[torch.LongTensor] = None,
|
810 |
+
past_key_value: Optional[Tuple[torch.Tensor]] = None,
|
811 |
+
output_attentions: Optional[bool] = False,
|
812 |
+
use_cache: Optional[bool] = False,
|
813 |
+
**kwargs,
|
814 |
+
) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
|
815 |
+
if "padding_mask" in kwargs:
|
816 |
+
warnings.warn(
|
817 |
+
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
|
818 |
+
)
|
819 |
+
"""
|
820 |
+
Args:
|
821 |
+
hidden_states (`torch.FloatTensor`):
|
822 |
+
input to the layer of shape `(batch, seq_len, embed_dim)`
|
823 |
+
attention_mask (`torch.FloatTensor`, *optional*): attention mask of size
|
824 |
+
`(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
|
825 |
+
position_ids (`torch.LongTensor` of shape `({0})`, *optional*):
|
826 |
+
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range
|
827 |
+
`[0, config.n_positions - 1]`. [What are position IDs?](../glossary#position-ids)
|
828 |
+
output_attentions (`bool`, *optional*):
|
829 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
|
830 |
+
returned tensors for more detail.
|
831 |
+
use_cache (`bool`, *optional*):
|
832 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
|
833 |
+
(see `past_key_values`).
|
834 |
+
past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached past key and value projection states
|
835 |
+
"""
|
836 |
+
|
837 |
+
residual = hidden_states
|
838 |
+
|
839 |
+
hidden_states = self.input_layernorm(hidden_states)
|
840 |
+
|
841 |
+
# Self Attention
|
842 |
+
attn_outputs, self_attn_weights, present_key_value = self.self_attn(
|
843 |
+
hidden_states=hidden_states,
|
844 |
+
attention_mask=attention_mask,
|
845 |
+
position_ids=position_ids,
|
846 |
+
past_key_value=past_key_value,
|
847 |
+
output_attentions=output_attentions,
|
848 |
+
use_cache=use_cache,
|
849 |
+
)
|
850 |
+
|
851 |
+
hidden_states = residual + self.resid_attn_dropout(attn_outputs)
|
852 |
+
|
853 |
+
residual = hidden_states
|
854 |
+
hidden_states = self.post_attention_layernorm(hidden_states)
|
855 |
+
hidden_states = self.mlp(hidden_states)
|
856 |
+
hidden_states = residual + self.resid_mlp_dropout(hidden_states)
|
857 |
+
|
858 |
+
outputs = (hidden_states,)
|
859 |
+
|
860 |
+
if output_attentions:
|
861 |
+
outputs += (self_attn_weights,)
|
862 |
+
|
863 |
+
if use_cache:
|
864 |
+
outputs += (present_key_value,)
|
865 |
+
|
866 |
+
return outputs
|
867 |
+
|
868 |
+
|
869 |
+
PHI3_START_DOCSTRING = r"""
|
870 |
+
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
|
871 |
+
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
|
872 |
+
etc.)
|
873 |
+
|
874 |
+
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
|
875 |
+
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
|
876 |
+
and behavior.
|
877 |
+
|
878 |
+
Parameters:
|
879 |
+
config ([`Phi3Config`]):
|
880 |
+
Model configuration class with all the parameters of the model. Initializing with a config file does not
|
881 |
+
load the weights associated with the model, only the configuration. Check out the
|
882 |
+
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
|
883 |
+
"""
|
884 |
+
|
885 |
+
|
886 |
+
@add_start_docstrings(
|
887 |
+
"The bare Phi-3 model outputting raw hidden-states without any specific head on top.",
|
888 |
+
PHI3_START_DOCSTRING,
|
889 |
+
)
|
890 |
+
class Phi3PreTrainedModel(PreTrainedModel):
|
891 |
+
config_class = Phi3Config
|
892 |
+
base_model_prefix = "model"
|
893 |
+
supports_gradient_checkpointing = True
|
894 |
+
_no_split_modules = ["Phi3DecoderLayer"]
|
895 |
+
_skip_keys_device_placement = "past_key_values"
|
896 |
+
_supports_flash_attn_2 = True
|
897 |
+
_supports_sdpa = False
|
898 |
+
_supports_cache_class = True
|
899 |
+
|
900 |
+
_version = "0.0.5"
|
901 |
+
|
902 |
+
def _init_weights(self, module):
|
903 |
+
std = self.config.initializer_range
|
904 |
+
if isinstance(module, nn.Linear):
|
905 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
906 |
+
if module.bias is not None:
|
907 |
+
module.bias.data.zero_()
|
908 |
+
elif isinstance(module, nn.Embedding):
|
909 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
910 |
+
if module.padding_idx is not None:
|
911 |
+
module.weight.data[module.padding_idx].zero_()
|
912 |
+
|
913 |
+
|
914 |
+
PHI3_INPUTS_DOCSTRING = r"""
|
915 |
+
Args:
|
916 |
+
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
|
917 |
+
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
|
918 |
+
it.
|
919 |
+
|
920 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
921 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
922 |
+
|
923 |
+
[What are input IDs?](../glossary#input-ids)
|
924 |
+
attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
|
925 |
+
Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
|
926 |
+
|
927 |
+
- 1 for tokens that are **not masked**,
|
928 |
+
- 0 for tokens that are **masked**.
|
929 |
+
|
930 |
+
[What are attention masks?](../glossary#attention-mask)
|
931 |
+
|
932 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
933 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
934 |
+
|
935 |
+
If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
|
936 |
+
`past_key_values`).
|
937 |
+
|
938 |
+
If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
|
939 |
+
and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
|
940 |
+
information on the default strategy.
|
941 |
+
|
942 |
+
- 1 indicates the head is **not masked**,
|
943 |
+
- 0 indicates the head is **masked**.
|
944 |
+
position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
945 |
+
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
|
946 |
+
config.n_positions - 1]`.
|
947 |
+
|
948 |
+
[What are position IDs?](../glossary#position-ids)
|
949 |
+
past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
|
950 |
+
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
|
951 |
+
blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
|
952 |
+
returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
|
953 |
+
|
954 |
+
Two formats are allowed:
|
955 |
+
- a [`~cache_utils.Cache`] instance;
|
956 |
+
- Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
|
957 |
+
shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
|
958 |
+
cache format.
|
959 |
+
|
960 |
+
The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
|
961 |
+
legacy cache format will be returned.
|
962 |
+
|
963 |
+
If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
|
964 |
+
have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
|
965 |
+
of shape `(batch_size, sequence_length)`.
|
966 |
+
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
|
967 |
+
Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
|
968 |
+
is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
|
969 |
+
model's internal embedding lookup matrix.
|
970 |
+
use_cache (`bool`, *optional*):
|
971 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
|
972 |
+
`past_key_values`).
|
973 |
+
output_attentions (`bool`, *optional*):
|
974 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
|
975 |
+
tensors for more detail.
|
976 |
+
output_hidden_states (`bool`, *optional*):
|
977 |
+
Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
|
978 |
+
more detail.
|
979 |
+
return_dict (`bool`, *optional*):
|
980 |
+
Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
|
981 |
+
"""
|
982 |
+
|
983 |
+
|
984 |
+
@add_start_docstrings(
|
985 |
+
"The bare Phi-3 model outputting raw hidden-states without any specific head on top.",
|
986 |
+
PHI3_START_DOCSTRING,
|
987 |
+
)
|
988 |
+
class Phi3Model(Phi3PreTrainedModel):
|
989 |
+
"""
|
990 |
+
Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`Phi3DecoderLayer`]
|
991 |
+
|
992 |
+
Args:
|
993 |
+
config: Phi3Config
|
994 |
+
"""
|
995 |
+
|
996 |
+
def __init__(self, config: Phi3Config):
|
997 |
+
super().__init__(config)
|
998 |
+
self.padding_idx = config.pad_token_id
|
999 |
+
self.vocab_size = config.vocab_size
|
1000 |
+
|
1001 |
+
self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
|
1002 |
+
self.embed_dropout = nn.Dropout(config.embd_pdrop)
|
1003 |
+
self.layers = nn.ModuleList(
|
1004 |
+
[Phi3DecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
|
1005 |
+
)
|
1006 |
+
self._attn_implementation = config._attn_implementation
|
1007 |
+
self.norm = Phi3RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
1008 |
+
|
1009 |
+
self.gradient_checkpointing = False
|
1010 |
+
# Initialize weights and apply final processing
|
1011 |
+
self.post_init()
|
1012 |
+
|
1013 |
+
def get_input_embeddings(self):
|
1014 |
+
return self.embed_tokens
|
1015 |
+
|
1016 |
+
def set_input_embeddings(self, value):
|
1017 |
+
self.embed_tokens = value
|
1018 |
+
|
1019 |
+
@add_start_docstrings_to_model_forward(PHI3_INPUTS_DOCSTRING)
|
1020 |
+
def forward(
|
1021 |
+
self,
|
1022 |
+
input_ids: torch.LongTensor = None,
|
1023 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1024 |
+
position_ids: Optional[torch.LongTensor] = None,
|
1025 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
1026 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
1027 |
+
use_cache: Optional[bool] = None,
|
1028 |
+
output_attentions: Optional[bool] = None,
|
1029 |
+
output_hidden_states: Optional[bool] = None,
|
1030 |
+
return_dict: Optional[bool] = None,
|
1031 |
+
) -> Union[Tuple, BaseModelOutputWithPast]:
|
1032 |
+
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|
1033 |
+
output_hidden_states = (
|
1034 |
+
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
1035 |
+
)
|
1036 |
+
use_cache = use_cache if use_cache is not None else self.config.use_cache
|
1037 |
+
|
1038 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
1039 |
+
|
1040 |
+
# retrieve input_ids and inputs_embeds
|
1041 |
+
if input_ids is not None and inputs_embeds is not None:
|
1042 |
+
raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
|
1043 |
+
elif input_ids is not None:
|
1044 |
+
batch_size, seq_length = input_ids.shape[:2]
|
1045 |
+
elif inputs_embeds is not None:
|
1046 |
+
batch_size, seq_length = inputs_embeds.shape[:2]
|
1047 |
+
else:
|
1048 |
+
raise ValueError("You have to specify either input_ids or inputs_embeds")
|
1049 |
+
|
1050 |
+
past_key_values_length = 0
|
1051 |
+
|
1052 |
+
if self.gradient_checkpointing and self.training:
|
1053 |
+
if use_cache:
|
1054 |
+
logger.warning_once(
|
1055 |
+
"`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
|
1056 |
+
)
|
1057 |
+
use_cache = False
|
1058 |
+
|
1059 |
+
if use_cache:
|
1060 |
+
use_legacy_cache = not isinstance(past_key_values, Cache)
|
1061 |
+
if use_legacy_cache:
|
1062 |
+
past_key_values = DynamicCache.from_legacy_cache(past_key_values)
|
1063 |
+
past_key_values_length = past_key_values.get_usable_length(seq_length)
|
1064 |
+
|
1065 |
+
if position_ids is None:
|
1066 |
+
device = input_ids.device if input_ids is not None else inputs_embeds.device
|
1067 |
+
position_ids = torch.arange(
|
1068 |
+
past_key_values_length, seq_length + past_key_values_length, dtype=torch.long, device=device
|
1069 |
+
)
|
1070 |
+
position_ids = position_ids.unsqueeze(0).view(-1, seq_length)
|
1071 |
+
else:
|
1072 |
+
position_ids = position_ids.view(-1, seq_length).long()
|
1073 |
+
|
1074 |
+
if inputs_embeds is None:
|
1075 |
+
inputs_embeds = self.embed_tokens(input_ids)
|
1076 |
+
|
1077 |
+
if attention_mask is not None and self._attn_implementation == "flash_attention_2" and use_cache:
|
1078 |
+
is_padding_right = attention_mask[:, -1].sum().item() != batch_size
|
1079 |
+
if is_padding_right:
|
1080 |
+
raise ValueError(
|
1081 |
+
"You are attempting to perform batched generation with padding_side='right'"
|
1082 |
+
" this may lead to unexpected behaviour for Flash Attention version of Phi3. Make sure to "
|
1083 |
+
" call `tokenizer.padding_side = 'left'` before tokenizing the input. "
|
1084 |
+
)
|
1085 |
+
|
1086 |
+
if self._attn_implementation == "flash_attention_2":
|
1087 |
+
# 2d mask is passed through the layers
|
1088 |
+
attention_mask = attention_mask if (attention_mask is not None and 0 in attention_mask) else None
|
1089 |
+
else:
|
1090 |
+
# 4d mask is passed through the layers
|
1091 |
+
attention_mask = _prepare_4d_causal_attention_mask(
|
1092 |
+
attention_mask,
|
1093 |
+
(batch_size, seq_length),
|
1094 |
+
inputs_embeds,
|
1095 |
+
past_key_values_length,
|
1096 |
+
sliding_window=self.config.sliding_window,
|
1097 |
+
)
|
1098 |
+
|
1099 |
+
hidden_states = inputs_embeds
|
1100 |
+
|
1101 |
+
# decoder layers
|
1102 |
+
all_hidden_states = () if output_hidden_states else None
|
1103 |
+
all_self_attns = () if output_attentions else None
|
1104 |
+
next_decoder_cache = None
|
1105 |
+
|
1106 |
+
for decoder_layer in self.layers:
|
1107 |
+
if output_hidden_states:
|
1108 |
+
all_hidden_states += (hidden_states,)
|
1109 |
+
|
1110 |
+
if self.gradient_checkpointing and self.training:
|
1111 |
+
layer_outputs = self._gradient_checkpointing_func(
|
1112 |
+
decoder_layer.__call__,
|
1113 |
+
hidden_states,
|
1114 |
+
attention_mask,
|
1115 |
+
position_ids,
|
1116 |
+
past_key_values,
|
1117 |
+
output_attentions,
|
1118 |
+
use_cache,
|
1119 |
+
)
|
1120 |
+
else:
|
1121 |
+
layer_outputs = decoder_layer(
|
1122 |
+
hidden_states,
|
1123 |
+
attention_mask=attention_mask,
|
1124 |
+
position_ids=position_ids,
|
1125 |
+
past_key_value=past_key_values,
|
1126 |
+
output_attentions=output_attentions,
|
1127 |
+
use_cache=use_cache,
|
1128 |
+
)
|
1129 |
+
|
1130 |
+
hidden_states = layer_outputs[0]
|
1131 |
+
|
1132 |
+
if use_cache:
|
1133 |
+
next_decoder_cache = layer_outputs[2 if output_attentions else 1]
|
1134 |
+
|
1135 |
+
if output_attentions:
|
1136 |
+
all_self_attns += (layer_outputs[1],)
|
1137 |
+
|
1138 |
+
hidden_states = self.norm(hidden_states)
|
1139 |
+
|
1140 |
+
# add hidden states from the last decoder layer
|
1141 |
+
if output_hidden_states:
|
1142 |
+
all_hidden_states += (hidden_states,)
|
1143 |
+
|
1144 |
+
next_cache = None
|
1145 |
+
if use_cache:
|
1146 |
+
next_cache = next_decoder_cache.to_legacy_cache() if use_legacy_cache else next_decoder_cache
|
1147 |
+
if not return_dict:
|
1148 |
+
return tuple(v for v in [hidden_states, next_cache, all_hidden_states, all_self_attns] if v is not None)
|
1149 |
+
return BaseModelOutputWithPast(
|
1150 |
+
last_hidden_state=hidden_states,
|
1151 |
+
past_key_values=next_cache,
|
1152 |
+
hidden_states=all_hidden_states,
|
1153 |
+
attentions=all_self_attns,
|
1154 |
+
)
|
1155 |
+
|
1156 |
+
|
1157 |
+
class Phi3ForCausalLM(Phi3PreTrainedModel):
|
1158 |
+
_tied_weights_keys = ["lm_head.weight"]
|
1159 |
+
|
1160 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.__init__ with Llama->Phi3
|
1161 |
+
def __init__(self, config):
|
1162 |
+
super().__init__(config)
|
1163 |
+
self.model = Phi3Model(config)
|
1164 |
+
self.vocab_size = config.vocab_size
|
1165 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
1166 |
+
|
1167 |
+
# Initialize weights and apply final processing
|
1168 |
+
self.post_init()
|
1169 |
+
|
1170 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.get_input_embeddings
|
1171 |
+
def get_input_embeddings(self):
|
1172 |
+
return self.model.embed_tokens
|
1173 |
+
|
1174 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.set_input_embeddings
|
1175 |
+
def set_input_embeddings(self, value):
|
1176 |
+
self.model.embed_tokens = value
|
1177 |
+
|
1178 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.get_output_embeddings
|
1179 |
+
def get_output_embeddings(self):
|
1180 |
+
return self.lm_head
|
1181 |
+
|
1182 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.set_output_embeddings
|
1183 |
+
def set_output_embeddings(self, new_embeddings):
|
1184 |
+
self.lm_head = new_embeddings
|
1185 |
+
|
1186 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.set_decoder
|
1187 |
+
def set_decoder(self, decoder):
|
1188 |
+
self.model = decoder
|
1189 |
+
|
1190 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM.get_decoder
|
1191 |
+
def get_decoder(self):
|
1192 |
+
return self.model
|
1193 |
+
|
1194 |
+
# Ignore copy
|
1195 |
+
@add_start_docstrings_to_model_forward(PHI3_INPUTS_DOCSTRING)
|
1196 |
+
@replace_return_docstrings(output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
|
1197 |
+
def forward(
|
1198 |
+
self,
|
1199 |
+
input_ids: torch.LongTensor = None,
|
1200 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1201 |
+
position_ids: Optional[torch.LongTensor] = None,
|
1202 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
1203 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
1204 |
+
labels: Optional[torch.LongTensor] = None,
|
1205 |
+
use_cache: Optional[bool] = None,
|
1206 |
+
output_attentions: Optional[bool] = None,
|
1207 |
+
output_hidden_states: Optional[bool] = None,
|
1208 |
+
return_dict: Optional[bool] = None,
|
1209 |
+
) -> Union[Tuple, CausalLMOutputWithPast]:
|
1210 |
+
r"""
|
1211 |
+
Args:
|
1212 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
1213 |
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
|
1214 |
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
1215 |
+
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
|
1216 |
+
|
1217 |
+
Returns:
|
1218 |
+
|
1219 |
+
Example:
|
1220 |
+
|
1221 |
+
```python
|
1222 |
+
>>> from transformers import AutoTokenizer, Phi3ForCausalLM
|
1223 |
+
|
1224 |
+
>>> model = Phi3ForCausalLM.from_pretrained("microsoft/phi-3-mini-4k-instruct")
|
1225 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-3-mini-4k-instruct")
|
1226 |
+
|
1227 |
+
>>> prompt = "This is an example script ."
|
1228 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
1229 |
+
|
1230 |
+
>>> # Generate
|
1231 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
1232 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
1233 |
+
'This is an example script .\n Certainly! Below is a sample script that demonstrates a simple task, such as calculating the sum'
|
1234 |
+
```"""
|
1235 |
+
|
1236 |
+
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|
1237 |
+
output_hidden_states = (
|
1238 |
+
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
1239 |
+
)
|
1240 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
1241 |
+
|
1242 |
+
# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
|
1243 |
+
outputs = self.model(
|
1244 |
+
input_ids=input_ids,
|
1245 |
+
attention_mask=attention_mask,
|
1246 |
+
position_ids=position_ids,
|
1247 |
+
past_key_values=past_key_values,
|
1248 |
+
inputs_embeds=inputs_embeds,
|
1249 |
+
use_cache=use_cache,
|
1250 |
+
output_attentions=output_attentions,
|
1251 |
+
output_hidden_states=output_hidden_states,
|
1252 |
+
return_dict=return_dict,
|
1253 |
+
)
|
1254 |
+
|
1255 |
+
hidden_states = outputs[0]
|
1256 |
+
logits = self.lm_head(hidden_states)
|
1257 |
+
logits = logits.float()
|
1258 |
+
|
1259 |
+
loss = None
|
1260 |
+
if labels is not None:
|
1261 |
+
# Shift so that tokens < n predict n
|
1262 |
+
shift_logits = logits[..., :-1, :].contiguous()
|
1263 |
+
shift_labels = labels[..., 1:].contiguous()
|
1264 |
+
# Flatten the tokens
|
1265 |
+
loss_fct = CrossEntropyLoss()
|
1266 |
+
shift_logits = shift_logits.view(-1, self.config.vocab_size)
|
1267 |
+
shift_labels = shift_labels.view(-1)
|
1268 |
+
# Enable model parallelism
|
1269 |
+
shift_labels = shift_labels.to(shift_logits.device)
|
1270 |
+
loss = loss_fct(shift_logits, shift_labels)
|
1271 |
+
|
1272 |
+
if not return_dict:
|
1273 |
+
output = (logits,) + outputs[1:]
|
1274 |
+
return (loss,) + output if loss is not None else output
|
1275 |
+
|
1276 |
+
return CausalLMOutputWithPast(
|
1277 |
+
loss=loss,
|
1278 |
+
logits=logits,
|
1279 |
+
past_key_values=outputs.past_key_values,
|
1280 |
+
hidden_states=outputs.hidden_states,
|
1281 |
+
attentions=outputs.attentions,
|
1282 |
+
)
|
1283 |
+
|
1284 |
+
# Copied from transformers.models.persimmon.modeling_persimmon.PersimmonForCausalLM.prepare_inputs_for_generation
|
1285 |
+
def prepare_inputs_for_generation(
|
1286 |
+
self, input_ids, past_key_values=None, attention_mask=None, inputs_embeds=None, **kwargs
|
1287 |
+
):
|
1288 |
+
# When the first time input length reached long and short factor switching point, enforce re-compute cache
|
1289 |
+
# It will cause downside of slower at this single token position, however, better than current failure.
|
1290 |
+
if past_key_values and self.config.rope_scaling and input_ids.shape[1] >= self.config.original_max_position_embeddings + 1:
|
1291 |
+
past_length = past_key_values.seen_tokens if isinstance(past_key_values, Cache) else past_key_values[0][0].shape[2]
|
1292 |
+
if past_length <= self.config.original_max_position_embeddings:
|
1293 |
+
past_key_values = None
|
1294 |
+
|
1295 |
+
if past_key_values is not None:
|
1296 |
+
if isinstance(past_key_values, Cache):
|
1297 |
+
cache_length = past_key_values.get_seq_length()
|
1298 |
+
past_length = past_key_values.seen_tokens
|
1299 |
+
max_cache_length = past_key_values.get_max_length()
|
1300 |
+
else:
|
1301 |
+
cache_length = past_length = past_key_values[0][0].shape[2]
|
1302 |
+
max_cache_length = None
|
1303 |
+
|
1304 |
+
# Keep only the unprocessed tokens:
|
1305 |
+
# 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where
|
1306 |
+
# some of the inputs are exclusively passed as part of the cache (e.g. when passing input_embeds as
|
1307 |
+
# input)
|
1308 |
+
if attention_mask is not None and attention_mask.shape[1] > input_ids.shape[1]:
|
1309 |
+
input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
|
1310 |
+
# 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
|
1311 |
+
# input_ids based on the past_length.
|
1312 |
+
elif past_length < input_ids.shape[1]:
|
1313 |
+
input_ids = input_ids[:, past_length:]
|
1314 |
+
# 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.
|
1315 |
+
|
1316 |
+
# If we are about to go beyond the maximum cache length, we need to crop the input attention mask.
|
1317 |
+
if (
|
1318 |
+
max_cache_length is not None
|
1319 |
+
and attention_mask is not None
|
1320 |
+
and cache_length + input_ids.shape[1] > max_cache_length
|
1321 |
+
):
|
1322 |
+
attention_mask = attention_mask[:, -max_cache_length:]
|
1323 |
+
|
1324 |
+
position_ids = kwargs.get("position_ids", None)
|
1325 |
+
if attention_mask is not None and position_ids is None:
|
1326 |
+
# create position_ids on the fly for batch generation
|
1327 |
+
position_ids = attention_mask.long().cumsum(-1) - 1
|
1328 |
+
position_ids.masked_fill_(attention_mask == 0, 1)
|
1329 |
+
if past_key_values:
|
1330 |
+
position_ids = position_ids[:, -input_ids.shape[1] :]
|
1331 |
+
|
1332 |
+
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
1333 |
+
if inputs_embeds is not None and past_key_values is None:
|
1334 |
+
model_inputs = {"inputs_embeds": inputs_embeds}
|
1335 |
+
else:
|
1336 |
+
model_inputs = {"input_ids": input_ids}
|
1337 |
+
|
1338 |
+
model_inputs.update(
|
1339 |
+
{
|
1340 |
+
"position_ids": position_ids,
|
1341 |
+
"past_key_values": past_key_values,
|
1342 |
+
"use_cache": kwargs.get("use_cache"),
|
1343 |
+
"attention_mask": attention_mask,
|
1344 |
+
}
|
1345 |
+
)
|
1346 |
+
return model_inputs
|
1347 |
+
|
1348 |
+
@staticmethod
|
1349 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForCausalLM._reorder_cache
|
1350 |
+
def _reorder_cache(past_key_values, beam_idx):
|
1351 |
+
reordered_past = ()
|
1352 |
+
for layer_past in past_key_values:
|
1353 |
+
reordered_past += (
|
1354 |
+
tuple(past_state.index_select(0, beam_idx.to(past_state.device)) for past_state in layer_past),
|
1355 |
+
)
|
1356 |
+
return reordered_past
|
1357 |
+
|
1358 |
+
|
1359 |
+
@add_start_docstrings(
|
1360 |
+
"""
|
1361 |
+
The [`Phi3Model`] with a sequence classification head on top (linear layer).
|
1362 |
+
|
1363 |
+
[`Phi3ForSequenceClassification`] uses the last token in order to do the classification, as other causal models
|
1364 |
+
(e.g. GPT-2) do.
|
1365 |
+
|
1366 |
+
Since it does classification on the last token, it requires to know the position of the last token. If a
|
1367 |
+
`pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
|
1368 |
+
no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
|
1369 |
+
padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
|
1370 |
+
each row of the batch).
|
1371 |
+
""",
|
1372 |
+
PHI3_START_DOCSTRING,
|
1373 |
+
)
|
1374 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaForSequenceClassification with Llama->Phi3, LLAMA->PHI3, self.transformer->self.model, transformer_outputs->model_outputs
|
1375 |
+
class Phi3ForSequenceClassification(Phi3PreTrainedModel):
|
1376 |
+
def __init__(self, config):
|
1377 |
+
super().__init__(config)
|
1378 |
+
self.num_labels = config.num_labels
|
1379 |
+
self.model = Phi3Model(config)
|
1380 |
+
self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
|
1381 |
+
|
1382 |
+
# Initialize weights and apply final processing
|
1383 |
+
self.post_init()
|
1384 |
+
|
1385 |
+
def get_input_embeddings(self):
|
1386 |
+
return self.model.embed_tokens
|
1387 |
+
|
1388 |
+
def set_input_embeddings(self, value):
|
1389 |
+
self.model.embed_tokens = value
|
1390 |
+
|
1391 |
+
@add_start_docstrings_to_model_forward(PHI3_INPUTS_DOCSTRING)
|
1392 |
+
def forward(
|
1393 |
+
self,
|
1394 |
+
input_ids: torch.LongTensor = None,
|
1395 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1396 |
+
position_ids: Optional[torch.LongTensor] = None,
|
1397 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
1398 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
1399 |
+
labels: Optional[torch.LongTensor] = None,
|
1400 |
+
use_cache: Optional[bool] = None,
|
1401 |
+
output_attentions: Optional[bool] = None,
|
1402 |
+
output_hidden_states: Optional[bool] = None,
|
1403 |
+
return_dict: Optional[bool] = None,
|
1404 |
+
) -> Union[Tuple, SequenceClassifierOutputWithPast]:
|
1405 |
+
r"""
|
1406 |
+
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
|
1407 |
+
Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
|
1408 |
+
config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
|
1409 |
+
`config.num_labels > 1` a classification loss is computed (Cross-Entropy).
|
1410 |
+
"""
|
1411 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
1412 |
+
|
1413 |
+
model_outputs = self.model(
|
1414 |
+
input_ids,
|
1415 |
+
attention_mask=attention_mask,
|
1416 |
+
position_ids=position_ids,
|
1417 |
+
past_key_values=past_key_values,
|
1418 |
+
inputs_embeds=inputs_embeds,
|
1419 |
+
use_cache=use_cache,
|
1420 |
+
output_attentions=output_attentions,
|
1421 |
+
output_hidden_states=output_hidden_states,
|
1422 |
+
return_dict=return_dict,
|
1423 |
+
)
|
1424 |
+
hidden_states = model_outputs[0]
|
1425 |
+
logits = self.score(hidden_states)
|
1426 |
+
|
1427 |
+
if input_ids is not None:
|
1428 |
+
batch_size = input_ids.shape[0]
|
1429 |
+
else:
|
1430 |
+
batch_size = inputs_embeds.shape[0]
|
1431 |
+
|
1432 |
+
if self.config.pad_token_id is None and batch_size != 1:
|
1433 |
+
raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
|
1434 |
+
if self.config.pad_token_id is None:
|
1435 |
+
sequence_lengths = -1
|
1436 |
+
else:
|
1437 |
+
if input_ids is not None:
|
1438 |
+
# if no pad token found, use modulo instead of reverse indexing for ONNX compatibility
|
1439 |
+
sequence_lengths = torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1
|
1440 |
+
sequence_lengths = sequence_lengths % input_ids.shape[-1]
|
1441 |
+
sequence_lengths = sequence_lengths.to(logits.device)
|
1442 |
+
else:
|
1443 |
+
sequence_lengths = -1
|
1444 |
+
|
1445 |
+
pooled_logits = logits[torch.arange(batch_size, device=logits.device), sequence_lengths]
|
1446 |
+
|
1447 |
+
loss = None
|
1448 |
+
if labels is not None:
|
1449 |
+
labels = labels.to(logits.device)
|
1450 |
+
if self.config.problem_type is None:
|
1451 |
+
if self.num_labels == 1:
|
1452 |
+
self.config.problem_type = "regression"
|
1453 |
+
elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
|
1454 |
+
self.config.problem_type = "single_label_classification"
|
1455 |
+
else:
|
1456 |
+
self.config.problem_type = "multi_label_classification"
|
1457 |
+
|
1458 |
+
if self.config.problem_type == "regression":
|
1459 |
+
loss_fct = MSELoss()
|
1460 |
+
if self.num_labels == 1:
|
1461 |
+
loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
|
1462 |
+
else:
|
1463 |
+
loss = loss_fct(pooled_logits, labels)
|
1464 |
+
elif self.config.problem_type == "single_label_classification":
|
1465 |
+
loss_fct = CrossEntropyLoss()
|
1466 |
+
loss = loss_fct(pooled_logits.view(-1, self.num_labels), labels.view(-1))
|
1467 |
+
elif self.config.problem_type == "multi_label_classification":
|
1468 |
+
loss_fct = BCEWithLogitsLoss()
|
1469 |
+
loss = loss_fct(pooled_logits, labels)
|
1470 |
+
if not return_dict:
|
1471 |
+
output = (pooled_logits,) + model_outputs[1:]
|
1472 |
+
return ((loss,) + output) if loss is not None else output
|
1473 |
+
|
1474 |
+
return SequenceClassifierOutputWithPast(
|
1475 |
+
loss=loss,
|
1476 |
+
logits=pooled_logits,
|
1477 |
+
past_key_values=model_outputs.past_key_values,
|
1478 |
+
hidden_states=model_outputs.hidden_states,
|
1479 |
+
attentions=model_outputs.attentions,
|
1480 |
+
)
|
1481 |
+
|
1482 |
+
|
1483 |
+
@add_start_docstrings(
|
1484 |
+
"""
|
1485 |
+
[`Phi3Model`] with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
|
1486 |
+
Named-Entity-Recognition (NER) tasks.
|
1487 |
+
""",
|
1488 |
+
PHI3_START_DOCSTRING,
|
1489 |
+
)
|
1490 |
+
# Copied from transformers.models.mpt.modeling_mpt.MptForTokenClassification with Mpt->Phi3,MPT->PHI3,self.transformer->self.model,transformer_outputs->model_outputs
|
1491 |
+
class Phi3ForTokenClassification(Phi3PreTrainedModel):
|
1492 |
+
def __init__(self, config: Phi3Config):
|
1493 |
+
super().__init__(config)
|
1494 |
+
self.num_labels = config.num_labels
|
1495 |
+
|
1496 |
+
self.model = Phi3Model(config)
|
1497 |
+
if hasattr(config, "classifier_dropout") and config.classifier_dropout is not None:
|
1498 |
+
classifier_dropout = config.classifier_dropout
|
1499 |
+
elif hasattr(config, "hidden_dropout") and config.hidden_dropout is not None:
|
1500 |
+
classifier_dropout = config.hidden_dropout
|
1501 |
+
else:
|
1502 |
+
classifier_dropout = 0.1
|
1503 |
+
self.dropout = nn.Dropout(classifier_dropout)
|
1504 |
+
self.classifier = nn.Linear(config.hidden_size, config.num_labels)
|
1505 |
+
|
1506 |
+
# Initialize weights and apply final processing
|
1507 |
+
self.post_init()
|
1508 |
+
|
1509 |
+
@add_start_docstrings_to_model_forward(PHI3_INPUTS_DOCSTRING)
|
1510 |
+
@add_code_sample_docstrings(
|
1511 |
+
checkpoint=_CHECKPOINT_FOR_DOC,
|
1512 |
+
output_type=TokenClassifierOutput,
|
1513 |
+
config_class=_CONFIG_FOR_DOC,
|
1514 |
+
)
|
1515 |
+
def forward(
|
1516 |
+
self,
|
1517 |
+
input_ids: Optional[torch.LongTensor] = None,
|
1518 |
+
past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
|
1519 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1520 |
+
inputs_embeds: Optional[torch.Tensor] = None,
|
1521 |
+
labels: Optional[torch.Tensor] = None,
|
1522 |
+
use_cache: Optional[bool] = None,
|
1523 |
+
output_attentions: Optional[bool] = None,
|
1524 |
+
output_hidden_states: Optional[bool] = None,
|
1525 |
+
return_dict: Optional[bool] = None,
|
1526 |
+
**deprecated_arguments,
|
1527 |
+
) -> Union[Tuple[torch.Tensor], TokenClassifierOutput]:
|
1528 |
+
r"""
|
1529 |
+
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
|
1530 |
+
Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
|
1531 |
+
config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
|
1532 |
+
`config.num_labels > 1` a classification loss is computed (Cross-Entropy).
|
1533 |
+
"""
|
1534 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
1535 |
+
|
1536 |
+
model_outputs = self.model(
|
1537 |
+
input_ids,
|
1538 |
+
past_key_values=past_key_values,
|
1539 |
+
attention_mask=attention_mask,
|
1540 |
+
inputs_embeds=inputs_embeds,
|
1541 |
+
use_cache=use_cache,
|
1542 |
+
output_attentions=output_attentions,
|
1543 |
+
output_hidden_states=output_hidden_states,
|
1544 |
+
return_dict=return_dict,
|
1545 |
+
)
|
1546 |
+
|
1547 |
+
hidden_states = model_outputs[0]
|
1548 |
+
hidden_states = self.dropout(hidden_states)
|
1549 |
+
logits = self.classifier(hidden_states)
|
1550 |
+
|
1551 |
+
loss = None
|
1552 |
+
if labels is not None:
|
1553 |
+
# move labels to correct device to enable model parallelism
|
1554 |
+
labels = labels.to(logits.device)
|
1555 |
+
batch_size, seq_length = labels.shape
|
1556 |
+
loss_fct = CrossEntropyLoss()
|
1557 |
+
loss = loss_fct(
|
1558 |
+
logits.view(batch_size * seq_length, self.num_labels), labels.view(batch_size * seq_length)
|
1559 |
+
)
|
1560 |
+
|
1561 |
+
if not return_dict:
|
1562 |
+
output = (logits,) + model_outputs[2:]
|
1563 |
+
return ((loss,) + output) if loss is not None else output
|
1564 |
+
|
1565 |
+
return TokenClassifierOutput(
|
1566 |
+
loss=loss,
|
1567 |
+
logits=logits,
|
1568 |
+
hidden_states=model_outputs.hidden_states,
|
1569 |
+
attentions=model_outputs.attentions,
|
1570 |
+
)
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|end|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<|endoftext|>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
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.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": true,
|
27 |
+
"single_word": false,
|
28 |
+
"special": false
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "<|endoftext|>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|assistant|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": true,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|placeholder1|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": true,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
+
"32003": {
|
55 |
+
"content": "<|placeholder2|>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": true,
|
59 |
+
"single_word": false,
|
60 |
+
"special": true
|
61 |
+
},
|
62 |
+
"32004": {
|
63 |
+
"content": "<|placeholder3|>",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": false,
|
66 |
+
"rstrip": true,
|
67 |
+
"single_word": false,
|
68 |
+
"special": true
|
69 |
+
},
|
70 |
+
"32005": {
|
71 |
+
"content": "<|placeholder4|>",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": false,
|
74 |
+
"rstrip": true,
|
75 |
+
"single_word": false,
|
76 |
+
"special": true
|
77 |
+
},
|
78 |
+
"32006": {
|
79 |
+
"content": "<|system|>",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": false,
|
82 |
+
"rstrip": true,
|
83 |
+
"single_word": false,
|
84 |
+
"special": true
|
85 |
+
},
|
86 |
+
"32007": {
|
87 |
+
"content": "<|end|>",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": false,
|
90 |
+
"rstrip": false,
|
91 |
+
"single_word": false,
|
92 |
+
"special": true
|
93 |
+
},
|
94 |
+
"32008": {
|
95 |
+
"content": "<|placeholder5|>",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": false,
|
98 |
+
"rstrip": true,
|
99 |
+
"single_word": false,
|
100 |
+
"special": true
|
101 |
+
},
|
102 |
+
"32009": {
|
103 |
+
"content": "<|placeholder6|>",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": false,
|
106 |
+
"rstrip": true,
|
107 |
+
"single_word": false,
|
108 |
+
"special": true
|
109 |
+
},
|
110 |
+
"32010": {
|
111 |
+
"content": "<|user|>",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": false,
|
114 |
+
"rstrip": true,
|
115 |
+
"single_word": false,
|
116 |
+
"special": true
|
117 |
+
}
|
118 |
+
},
|
119 |
+
"bos_token": "<s>",
|
120 |
+
"chat_template": "{{ '<s>' }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% endif %}{% if system_message is defined %}{{ '<|system|>\n' + system_message + '<|end|>\n' }}{% endif %}{% for message in loop_messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|user|>\n' + content + '<|end|>\n<|assistant|>\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|end|>' + '\n' }}{% endif %}{% endfor %}",
|
121 |
+
"clean_up_tokenization_spaces": false,
|
122 |
+
"eos_token": "<|end|>",
|
123 |
+
"legacy": false,
|
124 |
+
"model_max_length": 131072,
|
125 |
+
"pad_token": "<|endoftext|>",
|
126 |
+
"padding_side": "right",
|
127 |
+
"sp_model_kwargs": {},
|
128 |
+
"split_special_tokens": false,
|
129 |
+
"tokenizer_class": "LlamaTokenizer",
|
130 |
+
"unk_token": "<unk>",
|
131 |
+
"use_default_system_prompt": false
|
132 |
+
}
|
train_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 2.998027613412229,
|
3 |
+
"total_flos": 287426369617920.0,
|
4 |
+
"train_loss": 0.5032803327368017,
|
5 |
+
"train_runtime": 76434.0426,
|
6 |
+
"train_samples_per_second": 1.433,
|
7 |
+
"train_steps_per_second": 0.024
|
8 |
+
}
|
trainer_log.jsonl
ADDED
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"current_steps": 5, "total_steps": 1824, "loss": 1.79, "accuracy": 0.2800000011920929, "learning_rate": 1.358695652173913e-08, "epoch": 0.00821827744904668, "percentage": 0.27, "elapsed_time": "0:03:33", "remaining_time": "21:32:03"}
|
2 |
+
{"current_steps": 10, "total_steps": 1824, "loss": 1.7672, "accuracy": 0.6100000143051147, "learning_rate": 2.717391304347826e-08, "epoch": 0.01643655489809336, "percentage": 0.55, "elapsed_time": "0:07:01", "remaining_time": "21:13:01"}
|
3 |
+
{"current_steps": 15, "total_steps": 1824, "loss": 1.6603, "accuracy": 0.8799999952316284, "learning_rate": 4.076086956521739e-08, "epoch": 0.02465483234714004, "percentage": 0.82, "elapsed_time": "0:10:30", "remaining_time": "21:07:02"}
|
4 |
+
{"current_steps": 20, "total_steps": 1824, "loss": 1.5519, "accuracy": 0.9300000071525574, "learning_rate": 5.434782608695652e-08, "epoch": 0.03287310979618672, "percentage": 1.1, "elapsed_time": "0:13:58", "remaining_time": "21:00:24"}
|
5 |
+
{"current_steps": 25, "total_steps": 1824, "loss": 1.4535, "accuracy": 0.9300000071525574, "learning_rate": 6.793478260869565e-08, "epoch": 0.041091387245233396, "percentage": 1.37, "elapsed_time": "0:17:26", "remaining_time": "20:55:29"}
|
6 |
+
{"current_steps": 30, "total_steps": 1824, "loss": 1.3598, "accuracy": 0.9399999976158142, "learning_rate": 8.152173913043478e-08, "epoch": 0.04930966469428008, "percentage": 1.64, "elapsed_time": "0:20:56", "remaining_time": "20:52:25"}
|
7 |
+
{"current_steps": 35, "total_steps": 1824, "loss": 1.2944, "accuracy": 0.9200000166893005, "learning_rate": 9.510869565217392e-08, "epoch": 0.05752794214332676, "percentage": 1.92, "elapsed_time": "0:24:26", "remaining_time": "20:49:00"}
|
8 |
+
{"current_steps": 40, "total_steps": 1824, "loss": 1.2027, "accuracy": 0.9599999785423279, "learning_rate": 1.0869565217391303e-07, "epoch": 0.06574621959237344, "percentage": 2.19, "elapsed_time": "0:27:54", "remaining_time": "20:44:32"}
|
9 |
+
{"current_steps": 45, "total_steps": 1824, "loss": 1.1328, "accuracy": 0.949999988079071, "learning_rate": 1.2228260869565216e-07, "epoch": 0.07396449704142012, "percentage": 2.47, "elapsed_time": "0:31:22", "remaining_time": "20:40:31"}
|
10 |
+
{"current_steps": 50, "total_steps": 1824, "loss": 1.0599, "accuracy": 0.9900000095367432, "learning_rate": 1.358695652173913e-07, "epoch": 0.08218277449046679, "percentage": 2.74, "elapsed_time": "0:34:51", "remaining_time": "20:36:57"}
|
11 |
+
{"current_steps": 55, "total_steps": 1824, "loss": 1.0223, "accuracy": 0.9599999785423279, "learning_rate": 1.4945652173913042e-07, "epoch": 0.09040105193951348, "percentage": 3.02, "elapsed_time": "0:38:19", "remaining_time": "20:32:34"}
|
12 |
+
{"current_steps": 60, "total_steps": 1824, "loss": 1.0046, "accuracy": 0.9599999785423279, "learning_rate": 1.6304347826086955e-07, "epoch": 0.09861932938856016, "percentage": 3.29, "elapsed_time": "0:41:49", "remaining_time": "20:29:24"}
|
13 |
+
{"current_steps": 65, "total_steps": 1824, "loss": 0.9338, "accuracy": 0.949999988079071, "learning_rate": 1.766304347826087e-07, "epoch": 0.10683760683760683, "percentage": 3.56, "elapsed_time": "0:45:20", "remaining_time": "20:26:53"}
|
14 |
+
{"current_steps": 70, "total_steps": 1824, "loss": 0.8671, "accuracy": 0.9599999785423279, "learning_rate": 1.9021739130434784e-07, "epoch": 0.11505588428665352, "percentage": 3.84, "elapsed_time": "0:48:47", "remaining_time": "20:22:41"}
|
15 |
+
{"current_steps": 75, "total_steps": 1824, "loss": 0.8076, "accuracy": 0.9800000190734863, "learning_rate": 2.0380434782608694e-07, "epoch": 0.1232741617357002, "percentage": 4.11, "elapsed_time": "0:52:18", "remaining_time": "20:19:59"}
|
16 |
+
{"current_steps": 80, "total_steps": 1824, "loss": 0.842, "accuracy": 0.9399999976158142, "learning_rate": 2.1739130434782607e-07, "epoch": 0.13149243918474687, "percentage": 4.39, "elapsed_time": "0:55:49", "remaining_time": "20:16:49"}
|
17 |
+
{"current_steps": 85, "total_steps": 1824, "loss": 0.7489, "accuracy": 0.9700000286102295, "learning_rate": 2.309782608695652e-07, "epoch": 0.13971071663379356, "percentage": 4.66, "elapsed_time": "0:59:17", "remaining_time": "20:13:04"}
|
18 |
+
{"current_steps": 90, "total_steps": 1824, "loss": 0.8269, "accuracy": 0.9700000286102295, "learning_rate": 2.445652173913043e-07, "epoch": 0.14792899408284024, "percentage": 4.93, "elapsed_time": "1:02:46", "remaining_time": "20:09:19"}
|
19 |
+
{"current_steps": 95, "total_steps": 1824, "loss": 0.8771, "accuracy": 0.9100000262260437, "learning_rate": 2.499981493451693e-07, "epoch": 0.15614727153188693, "percentage": 5.21, "elapsed_time": "1:06:13", "remaining_time": "20:05:17"}
|
20 |
+
{"current_steps": 100, "total_steps": 1824, "loss": 0.7676, "accuracy": 0.9200000166893005, "learning_rate": 2.499868399863186e-07, "epoch": 0.16436554898093358, "percentage": 5.48, "elapsed_time": "1:09:41", "remaining_time": "20:01:27"}
|
21 |
+
{"current_steps": 105, "total_steps": 1824, "loss": 0.7133, "accuracy": 0.9300000071525574, "learning_rate": 2.4996525033926786e-07, "epoch": 0.17258382642998027, "percentage": 5.76, "elapsed_time": "1:13:10", "remaining_time": "19:58:04"}
|
22 |
+
{"current_steps": 110, "total_steps": 1824, "loss": 0.7642, "accuracy": 0.9399999976158142, "learning_rate": 2.499333821797864e-07, "epoch": 0.18080210387902695, "percentage": 6.03, "elapsed_time": "1:16:39", "remaining_time": "19:54:22"}
|
23 |
+
{"current_steps": 115, "total_steps": 1824, "loss": 0.7483, "accuracy": 0.949999988079071, "learning_rate": 2.4989123812906105e-07, "epoch": 0.18902038132807364, "percentage": 6.3, "elapsed_time": "1:20:06", "remaining_time": "19:50:33"}
|
24 |
+
{"current_steps": 120, "total_steps": 1824, "loss": 0.7063, "accuracy": 0.8799999952316284, "learning_rate": 2.498388216534807e-07, "epoch": 0.19723865877712032, "percentage": 6.58, "elapsed_time": "1:23:35", "remaining_time": "19:46:58"}
|
25 |
+
{"current_steps": 125, "total_steps": 1824, "loss": 0.7148, "accuracy": 0.949999988079071, "learning_rate": 2.49776137064351e-07, "epoch": 0.205456936226167, "percentage": 6.85, "elapsed_time": "1:27:04", "remaining_time": "19:43:24"}
|
26 |
+
{"current_steps": 130, "total_steps": 1824, "loss": 0.6619, "accuracy": 0.9800000190734863, "learning_rate": 2.4970318951754e-07, "epoch": 0.21367521367521367, "percentage": 7.13, "elapsed_time": "1:30:32", "remaining_time": "19:39:51"}
|
27 |
+
{"current_steps": 135, "total_steps": 1824, "loss": 0.7109, "accuracy": 0.9700000286102295, "learning_rate": 2.496199850130537e-07, "epoch": 0.22189349112426035, "percentage": 7.4, "elapsed_time": "1:34:01", "remaining_time": "19:36:20"}
|
28 |
+
{"current_steps": 140, "total_steps": 1824, "loss": 0.703, "accuracy": 0.9300000071525574, "learning_rate": 2.4952653039454297e-07, "epoch": 0.23011176857330704, "percentage": 7.68, "elapsed_time": "1:37:30", "remaining_time": "19:32:50"}
|
29 |
+
{"current_steps": 145, "total_steps": 1824, "loss": 0.6182, "accuracy": 0.949999988079071, "learning_rate": 2.494228333487403e-07, "epoch": 0.23833004602235372, "percentage": 7.95, "elapsed_time": "1:40:58", "remaining_time": "19:29:08"}
|
30 |
+
{"current_steps": 150, "total_steps": 1824, "loss": 0.671, "accuracy": 0.949999988079071, "learning_rate": 2.4930890240482784e-07, "epoch": 0.2465483234714004, "percentage": 8.22, "elapsed_time": "1:44:27", "remaining_time": "19:25:39"}
|
31 |
+
{"current_steps": 155, "total_steps": 1824, "loss": 0.6461, "accuracy": 0.9200000166893005, "learning_rate": 2.491847469337356e-07, "epoch": 0.25476660092044706, "percentage": 8.5, "elapsed_time": "1:47:56", "remaining_time": "19:22:20"}
|
32 |
+
{"current_steps": 160, "total_steps": 1824, "loss": 0.7398, "accuracy": 0.9700000286102295, "learning_rate": 2.4905037714737094e-07, "epoch": 0.26298487836949375, "percentage": 8.77, "elapsed_time": "1:51:25", "remaining_time": "19:18:44"}
|
33 |
+
{"current_steps": 165, "total_steps": 1824, "loss": 0.6633, "accuracy": 0.949999988079071, "learning_rate": 2.489058040977784e-07, "epoch": 0.27120315581854043, "percentage": 9.05, "elapsed_time": "1:54:53", "remaining_time": "19:15:10"}
|
34 |
+
{"current_steps": 170, "total_steps": 1824, "loss": 0.6512, "accuracy": 0.9700000286102295, "learning_rate": 2.487510396762309e-07, "epoch": 0.2794214332675871, "percentage": 9.32, "elapsed_time": "1:58:21", "remaining_time": "19:11:37"}
|
35 |
+
{"current_steps": 175, "total_steps": 1824, "loss": 0.6218, "accuracy": 0.9700000286102295, "learning_rate": 2.485860966122514e-07, "epoch": 0.2876397107166338, "percentage": 9.59, "elapsed_time": "2:01:50", "remaining_time": "19:08:03"}
|
36 |
+
{"current_steps": 180, "total_steps": 1824, "loss": 0.6908, "accuracy": 0.949999988079071, "learning_rate": 2.484109884725661e-07, "epoch": 0.2958579881656805, "percentage": 9.87, "elapsed_time": "2:05:20", "remaining_time": "19:04:43"}
|
37 |
+
{"current_steps": 185, "total_steps": 1824, "loss": 0.6008, "accuracy": 0.9599999785423279, "learning_rate": 2.4822572965998844e-07, "epoch": 0.30407626561472717, "percentage": 10.14, "elapsed_time": "2:08:48", "remaining_time": "19:01:11"}
|
38 |
+
{"current_steps": 190, "total_steps": 1824, "loss": 0.6281, "accuracy": 0.9599999785423279, "learning_rate": 2.4803033541223455e-07, "epoch": 0.31229454306377386, "percentage": 10.42, "elapsed_time": "2:12:16", "remaining_time": "18:57:37"}
|
39 |
+
{"current_steps": 195, "total_steps": 1824, "loss": 0.6158, "accuracy": 0.9700000286102295, "learning_rate": 2.478248218006699e-07, "epoch": 0.32051282051282054, "percentage": 10.69, "elapsed_time": "2:15:46", "remaining_time": "18:54:13"}
|
40 |
+
{"current_steps": 200, "total_steps": 1824, "loss": 0.6044, "accuracy": 0.9700000286102295, "learning_rate": 2.476092057289873e-07, "epoch": 0.32873109796186717, "percentage": 10.96, "elapsed_time": "2:19:14", "remaining_time": "18:50:39"}
|
41 |
+
{"current_steps": 205, "total_steps": 1824, "loss": 0.6532, "accuracy": 0.9599999785423279, "learning_rate": 2.473835049318167e-07, "epoch": 0.33694937541091385, "percentage": 11.24, "elapsed_time": "2:22:44", "remaining_time": "18:47:16"}
|
42 |
+
{"current_steps": 210, "total_steps": 1824, "loss": 0.6183, "accuracy": 0.9700000286102295, "learning_rate": 2.4714773797326657e-07, "epoch": 0.34516765285996054, "percentage": 11.51, "elapsed_time": "2:26:12", "remaining_time": "18:43:42"}
|
43 |
+
{"current_steps": 215, "total_steps": 1824, "loss": 0.6071, "accuracy": 0.9900000095367432, "learning_rate": 2.4690192424539663e-07, "epoch": 0.3533859303090072, "percentage": 11.79, "elapsed_time": "2:29:40", "remaining_time": "18:40:05"}
|
44 |
+
{"current_steps": 220, "total_steps": 1824, "loss": 0.562, "accuracy": 0.9700000286102295, "learning_rate": 2.466460839666233e-07, "epoch": 0.3616042077580539, "percentage": 12.06, "elapsed_time": "2:33:09", "remaining_time": "18:36:42"}
|
45 |
+
{"current_steps": 225, "total_steps": 1824, "loss": 0.6343, "accuracy": 0.9900000095367432, "learning_rate": 2.463802381800563e-07, "epoch": 0.3698224852071006, "percentage": 12.34, "elapsed_time": "2:36:37", "remaining_time": "18:33:03"}
|
46 |
+
{"current_steps": 230, "total_steps": 1824, "loss": 0.59, "accuracy": 0.9700000286102295, "learning_rate": 2.461044087517682e-07, "epoch": 0.3780407626561473, "percentage": 12.61, "elapsed_time": "2:40:05", "remaining_time": "18:29:30"}
|
47 |
+
{"current_steps": 235, "total_steps": 1824, "loss": 0.6427, "accuracy": 0.9200000166893005, "learning_rate": 2.458186183689957e-07, "epoch": 0.38625904010519396, "percentage": 12.88, "elapsed_time": "2:43:34", "remaining_time": "18:26:01"}
|
48 |
+
{"current_steps": 240, "total_steps": 1824, "loss": 0.5599, "accuracy": 0.9399999976158142, "learning_rate": 2.4552289053827344e-07, "epoch": 0.39447731755424065, "percentage": 13.16, "elapsed_time": "2:47:02", "remaining_time": "18:22:28"}
|
49 |
+
{"current_steps": 245, "total_steps": 1824, "loss": 0.6344, "accuracy": 0.9200000166893005, "learning_rate": 2.4521724958350093e-07, "epoch": 0.40269559500328733, "percentage": 13.43, "elapsed_time": "2:50:30", "remaining_time": "18:18:54"}
|
50 |
+
{"current_steps": 250, "total_steps": 1824, "loss": 0.5475, "accuracy": 0.9900000095367432, "learning_rate": 2.449017206439417e-07, "epoch": 0.410913872452334, "percentage": 13.71, "elapsed_time": "2:53:59", "remaining_time": "18:15:24"}
|
51 |
+
{"current_steps": 255, "total_steps": 1824, "loss": 0.6424, "accuracy": 0.9700000286102295, "learning_rate": 2.445763296721554e-07, "epoch": 0.41913214990138065, "percentage": 13.98, "elapsed_time": "2:57:26", "remaining_time": "18:11:47"}
|
52 |
+
{"current_steps": 260, "total_steps": 1824, "loss": 0.6183, "accuracy": 0.9300000071525574, "learning_rate": 2.4424110343186345e-07, "epoch": 0.42735042735042733, "percentage": 14.25, "elapsed_time": "3:00:55", "remaining_time": "18:08:19"}
|
53 |
+
{"current_steps": 265, "total_steps": 1824, "loss": 0.5961, "accuracy": 0.9800000190734863, "learning_rate": 2.4389606949574767e-07, "epoch": 0.435568704799474, "percentage": 14.53, "elapsed_time": "3:04:26", "remaining_time": "18:05:07"}
|
54 |
+
{"current_steps": 270, "total_steps": 1824, "loss": 0.547, "accuracy": 0.9200000166893005, "learning_rate": 2.435412562431823e-07, "epoch": 0.4437869822485207, "percentage": 14.8, "elapsed_time": "3:07:55", "remaining_time": "18:01:37"}
|
55 |
+
{"current_steps": 275, "total_steps": 1824, "loss": 0.5759, "accuracy": 0.9200000166893005, "learning_rate": 2.4317669285789964e-07, "epoch": 0.4520052596975674, "percentage": 15.08, "elapsed_time": "3:11:23", "remaining_time": "17:58:05"}
|
56 |
+
{"current_steps": 280, "total_steps": 1824, "loss": 0.6028, "accuracy": 0.9599999785423279, "learning_rate": 2.428024093255901e-07, "epoch": 0.46022353714661407, "percentage": 15.35, "elapsed_time": "3:14:55", "remaining_time": "17:54:52"}
|
57 |
+
{"current_steps": 285, "total_steps": 1824, "loss": 0.5687, "accuracy": 0.949999988079071, "learning_rate": 2.424184364314352e-07, "epoch": 0.46844181459566075, "percentage": 15.62, "elapsed_time": "3:18:24", "remaining_time": "17:51:24"}
|
58 |
+
{"current_steps": 290, "total_steps": 1824, "loss": 0.5783, "accuracy": 0.9700000286102295, "learning_rate": 2.420248057575761e-07, "epoch": 0.47666009204470744, "percentage": 15.9, "elapsed_time": "3:21:53", "remaining_time": "17:47:53"}
|
59 |
+
{"current_steps": 295, "total_steps": 1824, "loss": 0.5665, "accuracy": 0.9700000286102295, "learning_rate": 2.416215496805156e-07, "epoch": 0.4848783694937541, "percentage": 16.17, "elapsed_time": "3:25:21", "remaining_time": "17:44:24"}
|
60 |
+
{"current_steps": 300, "total_steps": 1824, "loss": 0.6409, "accuracy": 0.9800000190734863, "learning_rate": 2.412087013684552e-07, "epoch": 0.4930966469428008, "percentage": 16.45, "elapsed_time": "3:28:50", "remaining_time": "17:40:57"}
|
61 |
+
{"current_steps": 305, "total_steps": 1824, "loss": 0.487, "accuracy": 0.9800000190734863, "learning_rate": 2.407862947785669e-07, "epoch": 0.5013149243918474, "percentage": 16.72, "elapsed_time": "3:32:19", "remaining_time": "17:37:24"}
|
62 |
+
{"current_steps": 310, "total_steps": 1824, "loss": 0.6388, "accuracy": 0.9700000286102295, "learning_rate": 2.403543646542003e-07, "epoch": 0.5095332018408941, "percentage": 17.0, "elapsed_time": "3:35:48", "remaining_time": "17:33:58"}
|
63 |
+
{"current_steps": 315, "total_steps": 1824, "loss": 0.5741, "accuracy": 0.9700000286102295, "learning_rate": 2.39912946522025e-07, "epoch": 0.5177514792899408, "percentage": 17.27, "elapsed_time": "3:39:16", "remaining_time": "17:30:26"}
|
64 |
+
{"current_steps": 320, "total_steps": 1824, "loss": 0.5869, "accuracy": 0.9200000166893005, "learning_rate": 2.3946207668910833e-07, "epoch": 0.5259697567389875, "percentage": 17.54, "elapsed_time": "3:42:45", "remaining_time": "17:26:56"}
|
65 |
+
{"current_steps": 325, "total_steps": 1824, "loss": 0.6145, "accuracy": 0.949999988079071, "learning_rate": 2.390017922399292e-07, "epoch": 0.5341880341880342, "percentage": 17.82, "elapsed_time": "3:46:13", "remaining_time": "17:23:22"}
|
66 |
+
{"current_steps": 330, "total_steps": 1824, "loss": 0.6284, "accuracy": 0.9100000262260437, "learning_rate": 2.385321310333276e-07, "epoch": 0.5424063116370809, "percentage": 18.09, "elapsed_time": "3:49:41", "remaining_time": "17:19:54"}
|
67 |
+
{"current_steps": 335, "total_steps": 1824, "loss": 0.5688, "accuracy": 0.949999988079071, "learning_rate": 2.38053131699391e-07, "epoch": 0.5506245890861275, "percentage": 18.37, "elapsed_time": "3:53:10", "remaining_time": "17:16:24"}
|
68 |
+
{"current_steps": 340, "total_steps": 1824, "loss": 0.5981, "accuracy": 0.9700000286102295, "learning_rate": 2.3756483363627694e-07, "epoch": 0.5588428665351742, "percentage": 18.64, "elapsed_time": "3:56:38", "remaining_time": "17:12:50"}
|
69 |
+
{"current_steps": 345, "total_steps": 1824, "loss": 0.5567, "accuracy": 0.9800000190734863, "learning_rate": 2.3706727700697226e-07, "epoch": 0.5670611439842209, "percentage": 18.91, "elapsed_time": "4:00:06", "remaining_time": "17:09:20"}
|
70 |
+
{"current_steps": 350, "total_steps": 1824, "loss": 0.5363, "accuracy": 0.9599999785423279, "learning_rate": 2.3656050273598986e-07, "epoch": 0.5752794214332676, "percentage": 19.19, "elapsed_time": "4:03:35", "remaining_time": "17:05:53"}
|
71 |
+
{"current_steps": 355, "total_steps": 1824, "loss": 0.516, "accuracy": 0.949999988079071, "learning_rate": 2.3604455250600256e-07, "epoch": 0.5834976988823143, "percentage": 19.46, "elapsed_time": "4:07:03", "remaining_time": "17:02:21"}
|
72 |
+
{"current_steps": 360, "total_steps": 1824, "loss": 0.586, "accuracy": 1.0, "learning_rate": 2.3551946875441467e-07, "epoch": 0.591715976331361, "percentage": 19.74, "elapsed_time": "4:10:32", "remaining_time": "16:58:51"}
|
73 |
+
{"current_steps": 365, "total_steps": 1824, "loss": 0.6121, "accuracy": 0.9700000286102295, "learning_rate": 2.3498529466987147e-07, "epoch": 0.5999342537804077, "percentage": 20.01, "elapsed_time": "4:14:01", "remaining_time": "16:55:25"}
|
74 |
+
{"current_steps": 370, "total_steps": 1824, "loss": 0.5471, "accuracy": 0.9100000262260437, "learning_rate": 2.3444207418870688e-07, "epoch": 0.6081525312294543, "percentage": 20.29, "elapsed_time": "4:17:31", "remaining_time": "16:52:01"}
|
75 |
+
{"current_steps": 375, "total_steps": 1824, "loss": 0.5578, "accuracy": 0.949999988079071, "learning_rate": 2.3388985199132962e-07, "epoch": 0.616370808678501, "percentage": 20.56, "elapsed_time": "4:20:59", "remaining_time": "16:48:28"}
|
76 |
+
{"current_steps": 380, "total_steps": 1824, "loss": 0.6283, "accuracy": 0.949999988079071, "learning_rate": 2.3332867349854844e-07, "epoch": 0.6245890861275477, "percentage": 20.83, "elapsed_time": "4:24:29", "remaining_time": "16:45:05"}
|
77 |
+
{"current_steps": 385, "total_steps": 1824, "loss": 0.5824, "accuracy": 0.9599999785423279, "learning_rate": 2.3275858486783578e-07, "epoch": 0.6328073635765944, "percentage": 21.11, "elapsed_time": "4:27:58", "remaining_time": "16:41:34"}
|
78 |
+
{"current_steps": 390, "total_steps": 1824, "loss": 0.5813, "accuracy": 0.9700000286102295, "learning_rate": 2.321796329895317e-07, "epoch": 0.6410256410256411, "percentage": 21.38, "elapsed_time": "4:31:26", "remaining_time": "16:38:03"}
|
79 |
+
{"current_steps": 395, "total_steps": 1824, "loss": 0.5278, "accuracy": 0.949999988079071, "learning_rate": 2.3159186548298688e-07, "epoch": 0.6492439184746877, "percentage": 21.66, "elapsed_time": "4:34:54", "remaining_time": "16:34:33"}
|
80 |
+
{"current_steps": 400, "total_steps": 1824, "loss": 0.5419, "accuracy": 0.9399999976158142, "learning_rate": 2.3099533069264594e-07, "epoch": 0.6574621959237343, "percentage": 21.93, "elapsed_time": "4:38:23", "remaining_time": "16:31:03"}
|
81 |
+
{"current_steps": 405, "total_steps": 1824, "loss": 0.581, "accuracy": 0.9700000286102295, "learning_rate": 2.3039007768407098e-07, "epoch": 0.665680473372781, "percentage": 22.2, "elapsed_time": "4:41:51", "remaining_time": "16:27:33"}
|
82 |
+
{"current_steps": 410, "total_steps": 1824, "loss": 0.555, "accuracy": 0.9700000286102295, "learning_rate": 2.2977615623990603e-07, "epoch": 0.6738987508218277, "percentage": 22.48, "elapsed_time": "4:45:20", "remaining_time": "16:24:04"}
|
83 |
+
{"current_steps": 415, "total_steps": 1824, "loss": 0.5501, "accuracy": 0.9700000286102295, "learning_rate": 2.2915361685578235e-07, "epoch": 0.6821170282708744, "percentage": 22.75, "elapsed_time": "4:48:49", "remaining_time": "16:20:37"}
|
84 |
+
{"current_steps": 420, "total_steps": 1824, "loss": 0.4948, "accuracy": 0.9700000286102295, "learning_rate": 2.2852251073616503e-07, "epoch": 0.6903353057199211, "percentage": 23.03, "elapsed_time": "4:52:19", "remaining_time": "16:17:12"}
|
85 |
+
{"current_steps": 425, "total_steps": 1824, "loss": 0.5473, "accuracy": 0.9399999976158142, "learning_rate": 2.2788288979014132e-07, "epoch": 0.6985535831689678, "percentage": 23.3, "elapsed_time": "4:55:47", "remaining_time": "16:13:41"}
|
86 |
+
{"current_steps": 430, "total_steps": 1824, "loss": 0.5712, "accuracy": 0.8899999856948853, "learning_rate": 2.2723480662715134e-07, "epoch": 0.7067718606180144, "percentage": 23.57, "elapsed_time": "4:59:17", "remaining_time": "16:10:14"}
|
87 |
+
{"current_steps": 435, "total_steps": 1824, "loss": 0.6137, "accuracy": 0.9399999976158142, "learning_rate": 2.2657831455266063e-07, "epoch": 0.7149901380670611, "percentage": 23.85, "elapsed_time": "5:02:44", "remaining_time": "16:06:41"}
|
88 |
+
{"current_steps": 440, "total_steps": 1824, "loss": 0.5325, "accuracy": 0.9399999976158142, "learning_rate": 2.2591346756377588e-07, "epoch": 0.7232084155161078, "percentage": 24.12, "elapsed_time": "5:06:14", "remaining_time": "16:03:14"}
|
89 |
+
{"current_steps": 445, "total_steps": 1824, "loss": 0.5582, "accuracy": 0.9800000190734863, "learning_rate": 2.252403203448034e-07, "epoch": 0.7314266929651545, "percentage": 24.4, "elapsed_time": "5:09:42", "remaining_time": "15:59:43"}
|
90 |
+
{"current_steps": 450, "total_steps": 1824, "loss": 0.5556, "accuracy": 0.9700000286102295, "learning_rate": 2.2455892826275155e-07, "epoch": 0.7396449704142012, "percentage": 24.67, "elapsed_time": "5:13:11", "remaining_time": "15:56:15"}
|
91 |
+
{"current_steps": 455, "total_steps": 1824, "loss": 0.577, "accuracy": 0.9399999976158142, "learning_rate": 2.2386934736277666e-07, "epoch": 0.7478632478632479, "percentage": 24.95, "elapsed_time": "5:16:38", "remaining_time": "15:52:42"}
|
92 |
+
{"current_steps": 460, "total_steps": 1824, "loss": 0.5363, "accuracy": 0.9700000286102295, "learning_rate": 2.2317163436357317e-07, "epoch": 0.7560815253122946, "percentage": 25.22, "elapsed_time": "5:20:07", "remaining_time": "15:49:14"}
|
93 |
+
{"current_steps": 465, "total_steps": 1824, "loss": 0.4837, "accuracy": 0.9700000286102295, "learning_rate": 2.2246584665270855e-07, "epoch": 0.7642998027613412, "percentage": 25.49, "elapsed_time": "5:23:38", "remaining_time": "15:45:51"}
|
94 |
+
{"current_steps": 470, "total_steps": 1824, "loss": 0.6008, "accuracy": 0.9700000286102295, "learning_rate": 2.2175204228190308e-07, "epoch": 0.7725180802103879, "percentage": 25.77, "elapsed_time": "5:27:06", "remaining_time": "15:42:21"}
|
95 |
+
{"current_steps": 475, "total_steps": 1824, "loss": 0.5997, "accuracy": 0.9599999785423279, "learning_rate": 2.2103027996225512e-07, "epoch": 0.7807363576594346, "percentage": 26.04, "elapsed_time": "5:30:34", "remaining_time": "15:38:49"}
|
96 |
+
{"current_steps": 480, "total_steps": 1824, "loss": 0.5072, "accuracy": 0.9800000190734863, "learning_rate": 2.2030061905941193e-07, "epoch": 0.7889546351084813, "percentage": 26.32, "elapsed_time": "5:34:03", "remaining_time": "15:35:21"}
|
97 |
+
{"current_steps": 485, "total_steps": 1824, "loss": 0.4832, "accuracy": 0.9800000190734863, "learning_rate": 2.1956311958868684e-07, "epoch": 0.797172912557528, "percentage": 26.59, "elapsed_time": "5:37:31", "remaining_time": "15:31:50"}
|
98 |
+
{"current_steps": 490, "total_steps": 1824, "loss": 0.5522, "accuracy": 0.9100000262260437, "learning_rate": 2.1881784221012307e-07, "epoch": 0.8053911900065747, "percentage": 26.86, "elapsed_time": "5:41:00", "remaining_time": "15:28:22"}
|
99 |
+
{"current_steps": 495, "total_steps": 1824, "loss": 0.511, "accuracy": 0.9599999785423279, "learning_rate": 2.1806484822350417e-07, "epoch": 0.8136094674556213, "percentage": 27.14, "elapsed_time": "5:44:29", "remaining_time": "15:24:53"}
|
100 |
+
{"current_steps": 500, "total_steps": 1824, "loss": 0.4967, "accuracy": 0.9800000190734863, "learning_rate": 2.1730419956331215e-07, "epoch": 0.821827744904668, "percentage": 27.41, "elapsed_time": "5:47:57", "remaining_time": "15:21:24"}
|
101 |
+
{"current_steps": 505, "total_steps": 1824, "loss": 0.5762, "accuracy": 0.9800000190734863, "learning_rate": 2.1653595879363335e-07, "epoch": 0.8300460223537146, "percentage": 27.69, "elapsed_time": "5:51:24", "remaining_time": "15:17:51"}
|
102 |
+
{"current_steps": 510, "total_steps": 1824, "loss": 0.5308, "accuracy": 0.949999988079071, "learning_rate": 2.1576018910301238e-07, "epoch": 0.8382642998027613, "percentage": 27.96, "elapsed_time": "5:54:53", "remaining_time": "15:14:21"}
|
103 |
+
{"current_steps": 515, "total_steps": 1824, "loss": 0.5127, "accuracy": 0.9700000286102295, "learning_rate": 2.1497695429925497e-07, "epoch": 0.846482577251808, "percentage": 28.23, "elapsed_time": "5:58:23", "remaining_time": "15:10:57"}
|
104 |
+
{"current_steps": 520, "total_steps": 1824, "loss": 0.5705, "accuracy": 0.9700000286102295, "learning_rate": 2.1418631880417954e-07, "epoch": 0.8547008547008547, "percentage": 28.51, "elapsed_time": "6:01:52", "remaining_time": "15:07:27"}
|
105 |
+
{"current_steps": 525, "total_steps": 1824, "loss": 0.5076, "accuracy": 0.9800000190734863, "learning_rate": 2.1338834764831843e-07, "epoch": 0.8629191321499013, "percentage": 28.78, "elapsed_time": "6:05:20", "remaining_time": "15:03:57"}
|
106 |
+
{"current_steps": 530, "total_steps": 1824, "loss": 0.4869, "accuracy": 0.9599999785423279, "learning_rate": 2.125831064655693e-07, "epoch": 0.871137409598948, "percentage": 29.06, "elapsed_time": "6:08:48", "remaining_time": "15:00:27"}
|
107 |
+
{"current_steps": 535, "total_steps": 1824, "loss": 0.5328, "accuracy": 0.9800000190734863, "learning_rate": 2.1177066148779655e-07, "epoch": 0.8793556870479947, "percentage": 29.33, "elapsed_time": "6:12:17", "remaining_time": "14:56:59"}
|
108 |
+
{"current_steps": 540, "total_steps": 1824, "loss": 0.491, "accuracy": 0.9599999785423279, "learning_rate": 2.1095107953938348e-07, "epoch": 0.8875739644970414, "percentage": 29.61, "elapsed_time": "6:15:45", "remaining_time": "14:53:28"}
|
109 |
+
{"current_steps": 545, "total_steps": 1824, "loss": 0.452, "accuracy": 0.9700000286102295, "learning_rate": 2.1012442803173634e-07, "epoch": 0.8957922419460881, "percentage": 29.88, "elapsed_time": "6:19:14", "remaining_time": "14:50:00"}
|
110 |
+
{"current_steps": 550, "total_steps": 1824, "loss": 0.5177, "accuracy": 0.9599999785423279, "learning_rate": 2.0929077495773927e-07, "epoch": 0.9040105193951348, "percentage": 30.15, "elapsed_time": "6:22:44", "remaining_time": "14:46:33"}
|
111 |
+
{"current_steps": 555, "total_steps": 1824, "loss": 0.4794, "accuracy": 0.9800000190734863, "learning_rate": 2.0845018888616212e-07, "epoch": 0.9122287968441815, "percentage": 30.43, "elapsed_time": "6:26:11", "remaining_time": "14:43:02"}
|
112 |
+
{"current_steps": 560, "total_steps": 1824, "loss": 0.5335, "accuracy": 0.949999988079071, "learning_rate": 2.0760273895602037e-07, "epoch": 0.9204470742932281, "percentage": 30.7, "elapsed_time": "6:29:40", "remaining_time": "14:39:33"}
|
113 |
+
{"current_steps": 565, "total_steps": 1824, "loss": 0.5958, "accuracy": 0.949999988079071, "learning_rate": 2.0674849487088864e-07, "epoch": 0.9286653517422748, "percentage": 30.98, "elapsed_time": "6:33:10", "remaining_time": "14:36:07"}
|
114 |
+
{"current_steps": 570, "total_steps": 1824, "loss": 0.5319, "accuracy": 0.949999988079071, "learning_rate": 2.0588752689316723e-07, "epoch": 0.9368836291913215, "percentage": 31.25, "elapsed_time": "6:36:39", "remaining_time": "14:32:39"}
|
115 |
+
{"current_steps": 575, "total_steps": 1824, "loss": 0.4981, "accuracy": 0.9599999785423279, "learning_rate": 2.0501990583830315e-07, "epoch": 0.9451019066403682, "percentage": 31.52, "elapsed_time": "6:40:07", "remaining_time": "14:29:08"}
|
116 |
+
{"current_steps": 580, "total_steps": 1824, "loss": 0.5512, "accuracy": 0.9399999976158142, "learning_rate": 2.0414570306896536e-07, "epoch": 0.9533201840894149, "percentage": 31.8, "elapsed_time": "6:43:35", "remaining_time": "14:25:38"}
|
117 |
+
{"current_steps": 585, "total_steps": 1824, "loss": 0.5755, "accuracy": 0.9599999785423279, "learning_rate": 2.0326499048917527e-07, "epoch": 0.9615384615384616, "percentage": 32.07, "elapsed_time": "6:47:04", "remaining_time": "14:22:10"}
|
118 |
+
{"current_steps": 590, "total_steps": 1824, "loss": 0.4418, "accuracy": 0.9599999785423279, "learning_rate": 2.023778405383925e-07, "epoch": 0.9697567389875082, "percentage": 32.35, "elapsed_time": "6:50:32", "remaining_time": "14:18:38"}
|
119 |
+
{"current_steps": 595, "total_steps": 1824, "loss": 0.5262, "accuracy": 0.9599999785423279, "learning_rate": 2.0148432618555651e-07, "epoch": 0.9779750164365549, "percentage": 32.62, "elapsed_time": "6:54:00", "remaining_time": "14:15:08"}
|
120 |
+
{"current_steps": 600, "total_steps": 1824, "loss": 0.5167, "accuracy": 0.9599999785423279, "learning_rate": 2.005845209230851e-07, "epoch": 0.9861932938856016, "percentage": 32.89, "elapsed_time": "6:57:29", "remaining_time": "14:11:41"}
|
121 |
+
{"current_steps": 605, "total_steps": 1824, "loss": 0.5367, "accuracy": 0.949999988079071, "learning_rate": 1.9967849876082937e-07, "epoch": 0.9944115713346483, "percentage": 33.17, "elapsed_time": "7:00:57", "remaining_time": "14:08:11"}
|
122 |
+
{"current_steps": 610, "total_steps": 1824, "loss": 0.4734, "accuracy": 0.9800000190734863, "learning_rate": 1.9876633421998652e-07, "epoch": 1.0026298487836949, "percentage": 33.44, "elapsed_time": "7:04:50", "remaining_time": "14:05:29"}
|
123 |
+
{"current_steps": 615, "total_steps": 1824, "loss": 0.4473, "accuracy": 0.9700000286102295, "learning_rate": 1.9784810232697024e-07, "epoch": 1.0108481262327416, "percentage": 33.72, "elapsed_time": "7:08:18", "remaining_time": "14:01:59"}
|
124 |
+
{"current_steps": 620, "total_steps": 1824, "loss": 0.423, "accuracy": 1.0, "learning_rate": 1.969238786072398e-07, "epoch": 1.0190664036817882, "percentage": 33.99, "elapsed_time": "7:11:48", "remaining_time": "13:58:32"}
|
125 |
+
{"current_steps": 625, "total_steps": 1824, "loss": 0.4746, "accuracy": 0.9700000286102295, "learning_rate": 1.9599373907908803e-07, "epoch": 1.027284681130835, "percentage": 34.27, "elapsed_time": "7:15:16", "remaining_time": "13:55:01"}
|
126 |
+
{"current_steps": 630, "total_steps": 1824, "loss": 0.494, "accuracy": 0.9599999785423279, "learning_rate": 1.9505776024738873e-07, "epoch": 1.0355029585798816, "percentage": 34.54, "elapsed_time": "7:18:44", "remaining_time": "13:51:31"}
|
127 |
+
{"current_steps": 635, "total_steps": 1824, "loss": 0.5568, "accuracy": 0.949999988079071, "learning_rate": 1.9411601909730397e-07, "epoch": 1.0437212360289283, "percentage": 34.81, "elapsed_time": "7:22:14", "remaining_time": "13:48:03"}
|
128 |
+
{"current_steps": 640, "total_steps": 1824, "loss": 0.5268, "accuracy": 0.949999988079071, "learning_rate": 1.9316859308795215e-07, "epoch": 1.051939513477975, "percentage": 35.09, "elapsed_time": "7:25:44", "remaining_time": "13:44:36"}
|
129 |
+
{"current_steps": 645, "total_steps": 1824, "loss": 0.4933, "accuracy": 0.949999988079071, "learning_rate": 1.9221556014603674e-07, "epoch": 1.0601577909270217, "percentage": 35.36, "elapsed_time": "7:29:13", "remaining_time": "13:41:07"}
|
130 |
+
{"current_steps": 650, "total_steps": 1824, "loss": 0.4992, "accuracy": 0.9399999976158142, "learning_rate": 1.9125699865943696e-07, "epoch": 1.0683760683760684, "percentage": 35.64, "elapsed_time": "7:32:41", "remaining_time": "13:37:38"}
|
131 |
+
{"current_steps": 655, "total_steps": 1824, "loss": 0.4653, "accuracy": 1.0, "learning_rate": 1.9029298747076e-07, "epoch": 1.076594345825115, "percentage": 35.91, "elapsed_time": "7:36:10", "remaining_time": "13:34:08"}
|
132 |
+
{"current_steps": 660, "total_steps": 1824, "loss": 0.4897, "accuracy": 0.9800000190734863, "learning_rate": 1.893236058708565e-07, "epoch": 1.0848126232741617, "percentage": 36.18, "elapsed_time": "7:39:38", "remaining_time": "13:30:38"}
|
133 |
+
{"current_steps": 665, "total_steps": 1824, "loss": 0.4925, "accuracy": 0.9599999785423279, "learning_rate": 1.8834893359229839e-07, "epoch": 1.0930309007232084, "percentage": 36.46, "elapsed_time": "7:43:07", "remaining_time": "13:27:09"}
|
134 |
+
{"current_steps": 670, "total_steps": 1824, "loss": 0.5118, "accuracy": 0.9800000190734863, "learning_rate": 1.8736905080282117e-07, "epoch": 1.101249178172255, "percentage": 36.73, "elapsed_time": "7:46:35", "remaining_time": "13:23:39"}
|
135 |
+
{"current_steps": 675, "total_steps": 1824, "loss": 0.4881, "accuracy": 0.9100000262260437, "learning_rate": 1.8638403809872988e-07, "epoch": 1.1094674556213018, "percentage": 37.01, "elapsed_time": "7:50:03", "remaining_time": "13:20:08"}
|
136 |
+
{"current_steps": 680, "total_steps": 1824, "loss": 0.4408, "accuracy": 0.9800000190734863, "learning_rate": 1.8539397649826993e-07, "epoch": 1.1176857330703485, "percentage": 37.28, "elapsed_time": "7:53:32", "remaining_time": "13:16:39"}
|
137 |
+
{"current_steps": 685, "total_steps": 1824, "loss": 0.464, "accuracy": 0.9800000190734863, "learning_rate": 1.8439894743496336e-07, "epoch": 1.1259040105193951, "percentage": 37.55, "elapsed_time": "7:57:03", "remaining_time": "13:13:13"}
|
138 |
+
{"current_steps": 690, "total_steps": 1824, "loss": 0.4292, "accuracy": 1.0, "learning_rate": 1.8339903275091085e-07, "epoch": 1.1341222879684418, "percentage": 37.83, "elapsed_time": "8:00:32", "remaining_time": "13:09:45"}
|
139 |
+
{"current_steps": 695, "total_steps": 1824, "loss": 0.4627, "accuracy": 0.9399999976158142, "learning_rate": 1.8239431469006e-07, "epoch": 1.1423405654174885, "percentage": 38.1, "elapsed_time": "8:03:59", "remaining_time": "13:06:14"}
|
140 |
+
{"current_steps": 700, "total_steps": 1824, "loss": 0.5063, "accuracy": 0.9700000286102295, "learning_rate": 1.8138487589144093e-07, "epoch": 1.1505588428665352, "percentage": 38.38, "elapsed_time": "8:07:29", "remaining_time": "13:02:46"}
|
141 |
+
{"current_steps": 705, "total_steps": 1824, "loss": 0.4823, "accuracy": 0.9599999785423279, "learning_rate": 1.8037079938236894e-07, "epoch": 1.1587771203155819, "percentage": 38.65, "elapsed_time": "8:10:56", "remaining_time": "12:59:14"}
|
142 |
+
{"current_steps": 710, "total_steps": 1824, "loss": 0.4268, "accuracy": 0.9800000190734863, "learning_rate": 1.793521685716154e-07, "epoch": 1.1669953977646286, "percentage": 38.93, "elapsed_time": "8:14:26", "remaining_time": "12:55:47"}
|
143 |
+
{"current_steps": 715, "total_steps": 1824, "loss": 0.4347, "accuracy": 0.9700000286102295, "learning_rate": 1.7832906724254747e-07, "epoch": 1.1752136752136753, "percentage": 39.2, "elapsed_time": "8:17:54", "remaining_time": "12:52:17"}
|
144 |
+
{"current_steps": 720, "total_steps": 1824, "loss": 0.5001, "accuracy": 0.9599999785423279, "learning_rate": 1.7730157954623685e-07, "epoch": 1.183431952662722, "percentage": 39.47, "elapsed_time": "8:21:22", "remaining_time": "12:48:46"}
|
145 |
+
{"current_steps": 725, "total_steps": 1824, "loss": 0.3929, "accuracy": 0.9900000095367432, "learning_rate": 1.7626978999453794e-07, "epoch": 1.1916502301117686, "percentage": 39.75, "elapsed_time": "8:24:51", "remaining_time": "12:45:17"}
|
146 |
+
{"current_steps": 730, "total_steps": 1824, "loss": 0.5242, "accuracy": 0.9900000095367432, "learning_rate": 1.7523378345313714e-07, "epoch": 1.1998685075608153, "percentage": 40.02, "elapsed_time": "8:28:19", "remaining_time": "12:41:47"}
|
147 |
+
{"current_steps": 735, "total_steps": 1824, "loss": 0.4562, "accuracy": 0.9900000095367432, "learning_rate": 1.741936451345722e-07, "epoch": 1.208086785009862, "percentage": 40.3, "elapsed_time": "8:31:48", "remaining_time": "12:38:18"}
|
148 |
+
{"current_steps": 740, "total_steps": 1824, "loss": 0.4598, "accuracy": 0.9700000286102295, "learning_rate": 1.731494605912235e-07, "epoch": 1.2163050624589087, "percentage": 40.57, "elapsed_time": "8:35:17", "remaining_time": "12:34:49"}
|
149 |
+
{"current_steps": 745, "total_steps": 1824, "loss": 0.4921, "accuracy": 0.9599999785423279, "learning_rate": 1.721013157082774e-07, "epoch": 1.2245233399079554, "percentage": 40.84, "elapsed_time": "8:38:47", "remaining_time": "12:31:23"}
|
150 |
+
{"current_steps": 750, "total_steps": 1824, "loss": 0.5132, "accuracy": 0.9800000190734863, "learning_rate": 1.7104929669666194e-07, "epoch": 1.232741617357002, "percentage": 41.12, "elapsed_time": "8:42:16", "remaining_time": "12:27:53"}
|
151 |
+
{"current_steps": 755, "total_steps": 1824, "loss": 0.4746, "accuracy": 0.9599999785423279, "learning_rate": 1.69993490085956e-07, "epoch": 1.2409598948060487, "percentage": 41.39, "elapsed_time": "8:45:45", "remaining_time": "12:24:24"}
|
152 |
+
{"current_steps": 760, "total_steps": 1824, "loss": 0.4574, "accuracy": 0.9900000095367432, "learning_rate": 1.6893398271727222e-07, "epoch": 1.2491781722550954, "percentage": 41.67, "elapsed_time": "8:49:13", "remaining_time": "12:20:55"}
|
153 |
+
{"current_steps": 765, "total_steps": 1824, "loss": 0.4631, "accuracy": 1.0, "learning_rate": 1.6787086173611407e-07, "epoch": 1.2573964497041419, "percentage": 41.94, "elapsed_time": "8:52:42", "remaining_time": "12:17:25"}
|
154 |
+
{"current_steps": 770, "total_steps": 1824, "loss": 0.4905, "accuracy": 0.9800000190734863, "learning_rate": 1.6680421458520813e-07, "epoch": 1.2656147271531886, "percentage": 42.21, "elapsed_time": "8:56:10", "remaining_time": "12:13:55"}
|
155 |
+
{"current_steps": 775, "total_steps": 1824, "loss": 0.4091, "accuracy": 1.0, "learning_rate": 1.6573412899731187e-07, "epoch": 1.2738330046022353, "percentage": 42.49, "elapsed_time": "8:59:39", "remaining_time": "12:10:27"}
|
156 |
+
{"current_steps": 780, "total_steps": 1824, "loss": 0.4266, "accuracy": 0.9800000190734863, "learning_rate": 1.646606929879975e-07, "epoch": 1.282051282051282, "percentage": 42.76, "elapsed_time": "9:03:07", "remaining_time": "12:06:57"}
|
157 |
+
{"current_steps": 785, "total_steps": 1824, "loss": 0.5129, "accuracy": 0.9599999785423279, "learning_rate": 1.6358399484841268e-07, "epoch": 1.2902695595003286, "percentage": 43.04, "elapsed_time": "9:06:36", "remaining_time": "12:03:28"}
|
158 |
+
{"current_steps": 790, "total_steps": 1824, "loss": 0.4581, "accuracy": 0.9800000190734863, "learning_rate": 1.625041231380184e-07, "epoch": 1.2984878369493753, "percentage": 43.31, "elapsed_time": "9:10:05", "remaining_time": "11:59:59"}
|
159 |
+
{"current_steps": 795, "total_steps": 1824, "loss": 0.4713, "accuracy": 0.9599999785423279, "learning_rate": 1.6142116667730482e-07, "epoch": 1.306706114398422, "percentage": 43.59, "elapsed_time": "9:13:32", "remaining_time": "11:56:28"}
|
160 |
+
{"current_steps": 800, "total_steps": 1824, "loss": 0.4673, "accuracy": 0.9399999976158142, "learning_rate": 1.6033521454048597e-07, "epoch": 1.3149243918474687, "percentage": 43.86, "elapsed_time": "9:17:01", "remaining_time": "11:52:59"}
|
161 |
+
{"current_steps": 805, "total_steps": 1824, "loss": 0.4065, "accuracy": 0.9800000190734863, "learning_rate": 1.5924635604817306e-07, "epoch": 1.3231426692965154, "percentage": 44.13, "elapsed_time": "9:20:30", "remaining_time": "11:49:31"}
|
162 |
+
{"current_steps": 810, "total_steps": 1824, "loss": 0.429, "accuracy": 0.949999988079071, "learning_rate": 1.5815468076002771e-07, "epoch": 1.331360946745562, "percentage": 44.41, "elapsed_time": "9:23:59", "remaining_time": "11:46:01"}
|
163 |
+
{"current_steps": 815, "total_steps": 1824, "loss": 0.4521, "accuracy": 0.9700000286102295, "learning_rate": 1.5706027846739588e-07, "epoch": 1.3395792241946087, "percentage": 44.68, "elapsed_time": "9:27:28", "remaining_time": "11:42:33"}
|
164 |
+
{"current_steps": 820, "total_steps": 1824, "loss": 0.4833, "accuracy": 0.9200000166893005, "learning_rate": 1.5596323918592227e-07, "epoch": 1.3477975016436554, "percentage": 44.96, "elapsed_time": "9:30:58", "remaining_time": "11:39:06"}
|
165 |
+
{"current_steps": 825, "total_steps": 1824, "loss": 0.4084, "accuracy": 0.949999988079071, "learning_rate": 1.5486365314814637e-07, "epoch": 1.356015779092702, "percentage": 45.23, "elapsed_time": "9:34:26", "remaining_time": "11:35:36"}
|
166 |
+
{"current_steps": 830, "total_steps": 1824, "loss": 0.46, "accuracy": 0.949999988079071, "learning_rate": 1.5376161079608088e-07, "epoch": 1.3642340565417488, "percentage": 45.5, "elapsed_time": "9:37:56", "remaining_time": "11:32:08"}
|
167 |
+
{"current_steps": 835, "total_steps": 1824, "loss": 0.4435, "accuracy": 0.9599999785423279, "learning_rate": 1.5265720277377273e-07, "epoch": 1.3724523339907955, "percentage": 45.78, "elapsed_time": "9:41:26", "remaining_time": "11:28:40"}
|
168 |
+
{"current_steps": 840, "total_steps": 1824, "loss": 0.4849, "accuracy": 0.949999988079071, "learning_rate": 1.5155051991984745e-07, "epoch": 1.3806706114398422, "percentage": 46.05, "elapsed_time": "9:44:55", "remaining_time": "11:25:11"}
|
169 |
+
{"current_steps": 845, "total_steps": 1824, "loss": 0.4367, "accuracy": 0.9800000190734863, "learning_rate": 1.504416532600378e-07, "epoch": 1.3888888888888888, "percentage": 46.33, "elapsed_time": "9:48:23", "remaining_time": "11:21:41"}
|
170 |
+
{"current_steps": 850, "total_steps": 1824, "loss": 0.4617, "accuracy": 0.949999988079071, "learning_rate": 1.4933069399969653e-07, "epoch": 1.3971071663379355, "percentage": 46.6, "elapsed_time": "9:51:51", "remaining_time": "11:18:11"}
|
171 |
+
{"current_steps": 855, "total_steps": 1824, "loss": 0.4132, "accuracy": 0.9599999785423279, "learning_rate": 1.4821773351629487e-07, "epoch": 1.4053254437869822, "percentage": 46.88, "elapsed_time": "9:55:18", "remaining_time": "11:14:41"}
|
172 |
+
{"current_steps": 860, "total_steps": 1824, "loss": 0.4363, "accuracy": 0.9800000190734863, "learning_rate": 1.4710286335190664e-07, "epoch": 1.413543721236029, "percentage": 47.15, "elapsed_time": "9:58:46", "remaining_time": "11:11:10"}
|
173 |
+
{"current_steps": 865, "total_steps": 1824, "loss": 0.4445, "accuracy": 0.9800000190734863, "learning_rate": 1.4598617520567863e-07, "epoch": 1.4217619986850756, "percentage": 47.42, "elapsed_time": "10:02:15", "remaining_time": "11:07:41"}
|
174 |
+
{"current_steps": 870, "total_steps": 1824, "loss": 0.4916, "accuracy": 0.9399999976158142, "learning_rate": 1.448677609262885e-07, "epoch": 1.4299802761341223, "percentage": 47.7, "elapsed_time": "10:05:44", "remaining_time": "11:04:13"}
|
175 |
+
{"current_steps": 875, "total_steps": 1824, "loss": 0.353, "accuracy": 0.9800000190734863, "learning_rate": 1.4374771250438997e-07, "epoch": 1.438198553583169, "percentage": 47.97, "elapsed_time": "10:09:12", "remaining_time": "11:00:44"}
|
176 |
+
{"current_steps": 880, "total_steps": 1824, "loss": 0.4398, "accuracy": 0.9599999785423279, "learning_rate": 1.4262612206504653e-07, "epoch": 1.4464168310322156, "percentage": 48.25, "elapsed_time": "10:12:41", "remaining_time": "10:57:15"}
|
177 |
+
{"current_steps": 885, "total_steps": 1824, "loss": 0.4864, "accuracy": 0.9700000286102295, "learning_rate": 1.4150308186015428e-07, "epoch": 1.4546351084812623, "percentage": 48.52, "elapsed_time": "10:16:10", "remaining_time": "10:53:46"}
|
178 |
+
{"current_steps": 890, "total_steps": 1824, "loss": 0.4823, "accuracy": 0.9700000286102295, "learning_rate": 1.4037868426085368e-07, "epoch": 1.462853385930309, "percentage": 48.79, "elapsed_time": "10:19:38", "remaining_time": "10:50:16"}
|
179 |
+
{"current_steps": 895, "total_steps": 1824, "loss": 0.4288, "accuracy": 0.9599999785423279, "learning_rate": 1.3925302174993233e-07, "epoch": 1.4710716633793557, "percentage": 49.07, "elapsed_time": "10:23:07", "remaining_time": "10:46:48"}
|
180 |
+
{"current_steps": 900, "total_steps": 1824, "loss": 0.4755, "accuracy": 0.9800000190734863, "learning_rate": 1.3812618691421803e-07, "epoch": 1.4792899408284024, "percentage": 49.34, "elapsed_time": "10:26:36", "remaining_time": "10:43:18"}
|
181 |
+
{"current_steps": 905, "total_steps": 1824, "loss": 0.4732, "accuracy": 0.9300000071525574, "learning_rate": 1.3699827243696336e-07, "epoch": 1.487508218277449, "percentage": 49.62, "elapsed_time": "10:30:04", "remaining_time": "10:39:49"}
|
182 |
+
{"current_steps": 910, "total_steps": 1824, "loss": 0.4663, "accuracy": 0.9900000095367432, "learning_rate": 1.3586937109022251e-07, "epoch": 1.4957264957264957, "percentage": 49.89, "elapsed_time": "10:33:34", "remaining_time": "10:36:21"}
|
183 |
+
{"current_steps": 915, "total_steps": 1824, "loss": 0.4515, "accuracy": 1.0, "learning_rate": 1.347395757272207e-07, "epoch": 1.5039447731755424, "percentage": 50.16, "elapsed_time": "10:37:04", "remaining_time": "10:32:54"}
|
184 |
+
{"current_steps": 920, "total_steps": 1824, "loss": 0.4632, "accuracy": 0.9399999976158142, "learning_rate": 1.3360897927471668e-07, "epoch": 1.5121630506245891, "percentage": 50.44, "elapsed_time": "10:40:33", "remaining_time": "10:29:25"}
|
185 |
+
{"current_steps": 925, "total_steps": 1824, "loss": 0.4686, "accuracy": 0.9700000286102295, "learning_rate": 1.3247767472535972e-07, "epoch": 1.5203813280736358, "percentage": 50.71, "elapsed_time": "10:44:01", "remaining_time": "10:25:55"}
|
186 |
+
{"current_steps": 930, "total_steps": 1824, "loss": 0.3908, "accuracy": 0.9800000190734863, "learning_rate": 1.3134575513004073e-07, "epoch": 1.5285996055226825, "percentage": 50.99, "elapsed_time": "10:47:31", "remaining_time": "10:22:27"}
|
187 |
+
{"current_steps": 935, "total_steps": 1824, "loss": 0.4262, "accuracy": 1.0, "learning_rate": 1.3021331359023874e-07, "epoch": 1.5368178829717292, "percentage": 51.26, "elapsed_time": "10:50:59", "remaining_time": "10:18:57"}
|
188 |
+
{"current_steps": 940, "total_steps": 1824, "loss": 0.4616, "accuracy": 0.9900000095367432, "learning_rate": 1.2908044325036312e-07, "epoch": 1.5450361604207759, "percentage": 51.54, "elapsed_time": "10:54:27", "remaining_time": "10:15:28"}
|
189 |
+
{"current_steps": 945, "total_steps": 1824, "loss": 0.4502, "accuracy": 0.949999988079071, "learning_rate": 1.2794723729009255e-07, "epoch": 1.5532544378698225, "percentage": 51.81, "elapsed_time": "10:57:57", "remaining_time": "10:11:59"}
|
190 |
+
{"current_steps": 950, "total_steps": 1824, "loss": 0.4737, "accuracy": 0.9900000095367432, "learning_rate": 1.2681378891671082e-07, "epoch": 1.5614727153188692, "percentage": 52.08, "elapsed_time": "11:01:25", "remaining_time": "10:08:31"}
|
191 |
+
{"current_steps": 955, "total_steps": 1824, "loss": 0.4349, "accuracy": 0.9900000095367432, "learning_rate": 1.2568019135744044e-07, "epoch": 1.569690992767916, "percentage": 52.36, "elapsed_time": "11:04:53", "remaining_time": "10:05:00"}
|
192 |
+
{"current_steps": 960, "total_steps": 1824, "loss": 0.4231, "accuracy": 0.9900000095367432, "learning_rate": 1.2454653785177445e-07, "epoch": 1.5779092702169626, "percentage": 52.63, "elapsed_time": "11:08:22", "remaining_time": "10:01:32"}
|
193 |
+
{"current_steps": 965, "total_steps": 1824, "loss": 0.4817, "accuracy": 0.9399999976158142, "learning_rate": 1.2341292164380783e-07, "epoch": 1.5861275476660093, "percentage": 52.91, "elapsed_time": "11:11:50", "remaining_time": "9:58:02"}
|
194 |
+
{"current_steps": 970, "total_steps": 1824, "loss": 0.4114, "accuracy": 1.0, "learning_rate": 1.222794359745675e-07, "epoch": 1.594345825115056, "percentage": 53.18, "elapsed_time": "11:15:18", "remaining_time": "9:54:33"}
|
195 |
+
{"current_steps": 975, "total_steps": 1824, "loss": 0.4326, "accuracy": 0.9800000190734863, "learning_rate": 1.2114617407434354e-07, "epoch": 1.6025641025641026, "percentage": 53.45, "elapsed_time": "11:18:47", "remaining_time": "9:51:04"}
|
196 |
+
{"current_steps": 980, "total_steps": 1824, "loss": 0.3942, "accuracy": 0.9700000286102295, "learning_rate": 1.2001322915502091e-07, "epoch": 1.6107823800131493, "percentage": 53.73, "elapsed_time": "11:22:15", "remaining_time": "9:47:34"}
|
197 |
+
{"current_steps": 985, "total_steps": 1824, "loss": 0.4222, "accuracy": 0.9800000190734863, "learning_rate": 1.1888069440241243e-07, "epoch": 1.619000657462196, "percentage": 54.0, "elapsed_time": "11:25:43", "remaining_time": "9:44:05"}
|
198 |
+
{"current_steps": 990, "total_steps": 1824, "loss": 0.4749, "accuracy": 0.9800000190734863, "learning_rate": 1.1774866296859448e-07, "epoch": 1.6272189349112427, "percentage": 54.28, "elapsed_time": "11:29:13", "remaining_time": "9:40:36"}
|
199 |
+
{"current_steps": 995, "total_steps": 1824, "loss": 0.4268, "accuracy": 0.9900000095367432, "learning_rate": 1.1661722796424478e-07, "epoch": 1.6354372123602894, "percentage": 54.55, "elapsed_time": "11:32:42", "remaining_time": "9:37:08"}
|
200 |
+
{"current_steps": 1000, "total_steps": 1824, "loss": 0.4368, "accuracy": 0.9900000095367432, "learning_rate": 1.1548648245098432e-07, "epoch": 1.643655489809336, "percentage": 54.82, "elapsed_time": "11:36:13", "remaining_time": "9:33:41"}
|
201 |
+
{"current_steps": 1005, "total_steps": 1824, "loss": 0.4208, "accuracy": 1.0, "learning_rate": 1.1435651943372278e-07, "epoch": 1.6518737672583828, "percentage": 55.1, "elapsed_time": "11:39:41", "remaining_time": "9:30:11"}
|
202 |
+
{"current_steps": 1010, "total_steps": 1824, "loss": 0.4889, "accuracy": 0.9399999976158142, "learning_rate": 1.1322743185300865e-07, "epoch": 1.6600920447074294, "percentage": 55.37, "elapsed_time": "11:43:09", "remaining_time": "9:26:41"}
|
203 |
+
{"current_steps": 1015, "total_steps": 1824, "loss": 0.4487, "accuracy": 0.9800000190734863, "learning_rate": 1.1209931257738503e-07, "epoch": 1.6683103221564761, "percentage": 55.65, "elapsed_time": "11:46:38", "remaining_time": "9:23:13"}
|
204 |
+
{"current_steps": 1020, "total_steps": 1824, "loss": 0.4648, "accuracy": 0.949999988079071, "learning_rate": 1.1097225439575096e-07, "epoch": 1.6765285996055228, "percentage": 55.92, "elapsed_time": "11:50:07", "remaining_time": "9:19:44"}
|
205 |
+
{"current_steps": 1025, "total_steps": 1824, "loss": 0.5101, "accuracy": 0.9599999785423279, "learning_rate": 1.0984635000972946e-07, "epoch": 1.6847468770545695, "percentage": 56.2, "elapsed_time": "11:53:35", "remaining_time": "9:16:15"}
|
206 |
+
{"current_steps": 1030, "total_steps": 1824, "loss": 0.4259, "accuracy": 0.949999988079071, "learning_rate": 1.0872169202604284e-07, "epoch": 1.6929651545036162, "percentage": 56.47, "elapsed_time": "11:57:04", "remaining_time": "9:12:46"}
|
207 |
+
{"current_steps": 1035, "total_steps": 1824, "loss": 0.4365, "accuracy": 0.9700000286102295, "learning_rate": 1.0759837294889546e-07, "epoch": 1.7011834319526629, "percentage": 56.74, "elapsed_time": "12:00:31", "remaining_time": "9:09:16"}
|
208 |
+
{"current_steps": 1040, "total_steps": 1824, "loss": 0.4077, "accuracy": 0.9800000190734863, "learning_rate": 1.0647648517236547e-07, "epoch": 1.7094017094017095, "percentage": 57.02, "elapsed_time": "12:04:01", "remaining_time": "9:05:48"}
|
209 |
+
{"current_steps": 1045, "total_steps": 1824, "loss": 0.4578, "accuracy": 0.949999988079071, "learning_rate": 1.0535612097280505e-07, "epoch": 1.7176199868507562, "percentage": 57.29, "elapsed_time": "12:07:31", "remaining_time": "9:02:19"}
|
210 |
+
{"current_steps": 1050, "total_steps": 1824, "loss": 0.4706, "accuracy": 0.9599999785423279, "learning_rate": 1.042373725012508e-07, "epoch": 1.725838264299803, "percentage": 57.57, "elapsed_time": "12:10:59", "remaining_time": "8:58:50"}
|
211 |
+
{"current_steps": 1055, "total_steps": 1824, "loss": 0.3922, "accuracy": 0.9800000190734863, "learning_rate": 1.0312033177584409e-07, "epoch": 1.7340565417488496, "percentage": 57.84, "elapsed_time": "12:14:29", "remaining_time": "8:55:22"}
|
212 |
+
{"current_steps": 1060, "total_steps": 1824, "loss": 0.444, "accuracy": 0.9700000286102295, "learning_rate": 1.0200509067426243e-07, "epoch": 1.7422748191978963, "percentage": 58.11, "elapsed_time": "12:17:58", "remaining_time": "8:51:53"}
|
213 |
+
{"current_steps": 1065, "total_steps": 1824, "loss": 0.4607, "accuracy": 0.9399999976158142, "learning_rate": 1.0089174092616271e-07, "epoch": 1.7504930966469427, "percentage": 58.39, "elapsed_time": "12:21:26", "remaining_time": "8:48:24"}
|
214 |
+
{"current_steps": 1070, "total_steps": 1824, "loss": 0.3879, "accuracy": 0.949999988079071, "learning_rate": 9.97803741056361e-08, "epoch": 1.7587113740959894, "percentage": 58.66, "elapsed_time": "12:24:57", "remaining_time": "8:44:56"}
|
215 |
+
{"current_steps": 1075, "total_steps": 1824, "loss": 0.3974, "accuracy": 0.9700000286102295, "learning_rate": 9.867108162367594e-08, "epoch": 1.7669296515450361, "percentage": 58.94, "elapsed_time": "12:28:26", "remaining_time": "8:41:28"}
|
216 |
+
{"current_steps": 1080, "total_steps": 1824, "loss": 0.4368, "accuracy": 0.9700000286102295, "learning_rate": 9.756395472065947e-08, "epoch": 1.7751479289940828, "percentage": 59.21, "elapsed_time": "12:31:56", "remaining_time": "8:38:00"}
|
217 |
+
{"current_steps": 1085, "total_steps": 1824, "loss": 0.392, "accuracy": 1.0, "learning_rate": 9.645908445884271e-08, "epoch": 1.7833662064431295, "percentage": 59.48, "elapsed_time": "12:35:24", "remaining_time": "8:34:30"}
|
218 |
+
{"current_steps": 1090, "total_steps": 1824, "loss": 0.4113, "accuracy": 0.9900000095367432, "learning_rate": 9.535656171487096e-08, "epoch": 1.7915844838921762, "percentage": 59.76, "elapsed_time": "12:38:53", "remaining_time": "8:31:02"}
|
219 |
+
{"current_steps": 1095, "total_steps": 1824, "loss": 0.4062, "accuracy": 0.949999988079071, "learning_rate": 9.425647717230382e-08, "epoch": 1.7998027613412229, "percentage": 60.03, "elapsed_time": "12:42:22", "remaining_time": "8:27:33"}
|
220 |
+
{"current_steps": 1100, "total_steps": 1824, "loss": 0.3948, "accuracy": 0.9800000190734863, "learning_rate": 9.315892131415642e-08, "epoch": 1.8080210387902695, "percentage": 60.31, "elapsed_time": "12:45:50", "remaining_time": "8:24:04"}
|
221 |
+
{"current_steps": 1105, "total_steps": 1824, "loss": 0.3759, "accuracy": 1.0, "learning_rate": 9.206398441545729e-08, "epoch": 1.8162393162393162, "percentage": 60.58, "elapsed_time": "12:49:20", "remaining_time": "8:20:35"}
|
222 |
+
{"current_steps": 1110, "total_steps": 1824, "loss": 0.41, "accuracy": 0.9599999785423279, "learning_rate": 9.097175653582299e-08, "epoch": 1.824457593688363, "percentage": 60.86, "elapsed_time": "12:52:49", "remaining_time": "8:17:07"}
|
223 |
+
{"current_steps": 1115, "total_steps": 1824, "loss": 0.4401, "accuracy": 0.9599999785423279, "learning_rate": 8.988232751205051e-08, "epoch": 1.8326758711374096, "percentage": 61.13, "elapsed_time": "12:56:16", "remaining_time": "8:13:37"}
|
224 |
+
{"current_steps": 1120, "total_steps": 1824, "loss": 0.4135, "accuracy": 0.9800000190734863, "learning_rate": 8.879578695072846e-08, "epoch": 1.8408941485864563, "percentage": 61.4, "elapsed_time": "12:59:46", "remaining_time": "8:10:08"}
|
225 |
+
{"current_steps": 1125, "total_steps": 1824, "loss": 0.3998, "accuracy": 0.9800000190734863, "learning_rate": 8.771222422086639e-08, "epoch": 1.849112426035503, "percentage": 61.68, "elapsed_time": "13:03:14", "remaining_time": "8:06:39"}
|
226 |
+
{"current_steps": 1130, "total_steps": 1824, "loss": 0.4455, "accuracy": 0.9700000286102295, "learning_rate": 8.663172844654452e-08, "epoch": 1.8573307034845496, "percentage": 61.95, "elapsed_time": "13:06:42", "remaining_time": "8:03:10"}
|
227 |
+
{"current_steps": 1135, "total_steps": 1824, "loss": 0.3864, "accuracy": 0.949999988079071, "learning_rate": 8.555438849958296e-08, "epoch": 1.8655489809335963, "percentage": 62.23, "elapsed_time": "13:10:10", "remaining_time": "7:59:40"}
|
228 |
+
{"current_steps": 1140, "total_steps": 1824, "loss": 0.4933, "accuracy": 0.949999988079071, "learning_rate": 8.448029299223194e-08, "epoch": 1.873767258382643, "percentage": 62.5, "elapsed_time": "13:13:38", "remaining_time": "7:56:10"}
|
229 |
+
{"current_steps": 1145, "total_steps": 1824, "loss": 0.4615, "accuracy": 0.9599999785423279, "learning_rate": 8.340953026988351e-08, "epoch": 1.8819855358316897, "percentage": 62.77, "elapsed_time": "13:17:05", "remaining_time": "7:52:41"}
|
230 |
+
{"current_steps": 1150, "total_steps": 1824, "loss": 0.4341, "accuracy": 0.9700000286102295, "learning_rate": 8.234218840380475e-08, "epoch": 1.8902038132807364, "percentage": 63.05, "elapsed_time": "13:20:32", "remaining_time": "7:49:11"}
|
231 |
+
{"current_steps": 1155, "total_steps": 1824, "loss": 0.4095, "accuracy": 0.9800000190734863, "learning_rate": 8.127835518389417e-08, "epoch": 1.898422090729783, "percentage": 63.32, "elapsed_time": "13:24:00", "remaining_time": "7:45:42"}
|
232 |
+
{"current_steps": 1160, "total_steps": 1824, "loss": 0.4551, "accuracy": 0.9599999785423279, "learning_rate": 8.021811811146075e-08, "epoch": 1.9066403681788298, "percentage": 63.6, "elapsed_time": "13:27:28", "remaining_time": "7:42:12"}
|
233 |
+
{"current_steps": 1165, "total_steps": 1824, "loss": 0.4289, "accuracy": 0.9800000190734863, "learning_rate": 7.916156439202672e-08, "epoch": 1.9148586456278764, "percentage": 63.87, "elapsed_time": "13:30:58", "remaining_time": "7:38:44"}
|
234 |
+
{"current_steps": 1170, "total_steps": 1824, "loss": 0.3663, "accuracy": 0.9700000286102295, "learning_rate": 7.810878092815512e-08, "epoch": 1.9230769230769231, "percentage": 64.14, "elapsed_time": "13:34:25", "remaining_time": "7:35:14"}
|
235 |
+
{"current_steps": 1175, "total_steps": 1824, "loss": 0.391, "accuracy": 0.9800000190734863, "learning_rate": 7.705985431230183e-08, "epoch": 1.9312952005259696, "percentage": 64.42, "elapsed_time": "13:37:56", "remaining_time": "7:31:47"}
|
236 |
+
{"current_steps": 1180, "total_steps": 1824, "loss": 0.3851, "accuracy": 0.9300000071525574, "learning_rate": 7.601487081969307e-08, "epoch": 1.9395134779750163, "percentage": 64.69, "elapsed_time": "13:41:26", "remaining_time": "7:28:18"}
|
237 |
+
{"current_steps": 1185, "total_steps": 1824, "loss": 0.4041, "accuracy": 0.9700000286102295, "learning_rate": 7.497391640122967e-08, "epoch": 1.947731755424063, "percentage": 64.97, "elapsed_time": "13:44:55", "remaining_time": "7:24:50"}
|
238 |
+
{"current_steps": 1190, "total_steps": 1824, "loss": 0.4276, "accuracy": 0.9700000286102295, "learning_rate": 7.393707667641691e-08, "epoch": 1.9559500328731096, "percentage": 65.24, "elapsed_time": "13:48:24", "remaining_time": "7:21:21"}
|
239 |
+
{"current_steps": 1195, "total_steps": 1824, "loss": 0.4942, "accuracy": 0.9700000286102295, "learning_rate": 7.290443692632281e-08, "epoch": 1.9641683103221563, "percentage": 65.52, "elapsed_time": "13:51:52", "remaining_time": "7:17:52"}
|
240 |
+
{"current_steps": 1200, "total_steps": 1824, "loss": 0.3964, "accuracy": 0.9900000095367432, "learning_rate": 7.187608208656328e-08, "epoch": 1.972386587771203, "percentage": 65.79, "elapsed_time": "13:55:20", "remaining_time": "7:14:22"}
|
241 |
+
{"current_steps": 1205, "total_steps": 1824, "loss": 0.3766, "accuracy": 0.9800000190734863, "learning_rate": 7.085209674031618e-08, "epoch": 1.9806048652202497, "percentage": 66.06, "elapsed_time": "13:58:48", "remaining_time": "7:10:53"}
|
242 |
+
{"current_steps": 1210, "total_steps": 1824, "loss": 0.3878, "accuracy": 0.949999988079071, "learning_rate": 6.983256511136442e-08, "epoch": 1.9888231426692964, "percentage": 66.34, "elapsed_time": "14:02:17", "remaining_time": "7:07:24"}
|
243 |
+
{"current_steps": 1215, "total_steps": 1824, "loss": 0.4009, "accuracy": 0.9900000095367432, "learning_rate": 6.881757105716831e-08, "epoch": 1.997041420118343, "percentage": 66.61, "elapsed_time": "14:05:46", "remaining_time": "7:03:55"}
|
244 |
+
{"current_steps": 1220, "total_steps": 1824, "loss": 0.4449, "accuracy": 0.9800000190734863, "learning_rate": 6.780719806196828e-08, "epoch": 2.0052596975673898, "percentage": 66.89, "elapsed_time": "14:09:42", "remaining_time": "7:00:40"}
|
245 |
+
{"current_steps": 1225, "total_steps": 1824, "loss": 0.3868, "accuracy": 0.9599999785423279, "learning_rate": 6.680152922991822e-08, "epoch": 2.0134779750164364, "percentage": 67.16, "elapsed_time": "14:13:10", "remaining_time": "6:57:11"}
|
246 |
+
{"current_steps": 1230, "total_steps": 1824, "loss": 0.4093, "accuracy": 0.9399999976158142, "learning_rate": 6.580064727824994e-08, "epoch": 2.021696252465483, "percentage": 67.43, "elapsed_time": "14:16:38", "remaining_time": "6:53:41"}
|
247 |
+
{"current_steps": 1235, "total_steps": 1824, "loss": 0.4202, "accuracy": 0.9599999785423279, "learning_rate": 6.480463453046985e-08, "epoch": 2.02991452991453, "percentage": 67.71, "elapsed_time": "14:20:06", "remaining_time": "6:50:12"}
|
248 |
+
{"current_steps": 1240, "total_steps": 1824, "loss": 0.3722, "accuracy": 0.9900000095367432, "learning_rate": 6.381357290958767e-08, "epoch": 2.0381328073635765, "percentage": 67.98, "elapsed_time": "14:23:36", "remaining_time": "6:46:44"}
|
249 |
+
{"current_steps": 1245, "total_steps": 1824, "loss": 0.4065, "accuracy": 0.9599999785423279, "learning_rate": 6.282754393137796e-08, "epoch": 2.046351084812623, "percentage": 68.26, "elapsed_time": "14:27:04", "remaining_time": "6:43:14"}
|
250 |
+
{"current_steps": 1250, "total_steps": 1824, "loss": 0.4175, "accuracy": 0.949999988079071, "learning_rate": 6.184662869767577e-08, "epoch": 2.05456936226167, "percentage": 68.53, "elapsed_time": "14:30:33", "remaining_time": "6:39:45"}
|
251 |
+
{"current_steps": 1255, "total_steps": 1824, "loss": 0.4021, "accuracy": 0.9599999785423279, "learning_rate": 6.08709078897056e-08, "epoch": 2.0627876397107165, "percentage": 68.8, "elapsed_time": "14:34:02", "remaining_time": "6:36:16"}
|
252 |
+
{"current_steps": 1260, "total_steps": 1824, "loss": 0.4283, "accuracy": 0.9100000262260437, "learning_rate": 5.990046176144551e-08, "epoch": 2.0710059171597632, "percentage": 69.08, "elapsed_time": "14:37:29", "remaining_time": "6:32:47"}
|
253 |
+
{"current_steps": 1265, "total_steps": 1824, "loss": 0.4253, "accuracy": 0.9900000095367432, "learning_rate": 5.893537013302602e-08, "epoch": 2.07922419460881, "percentage": 69.35, "elapsed_time": "14:40:57", "remaining_time": "6:29:17"}
|
254 |
+
{"current_steps": 1270, "total_steps": 1824, "loss": 0.4009, "accuracy": 0.9700000286102295, "learning_rate": 5.7975712384164795e-08, "epoch": 2.0874424720578566, "percentage": 69.63, "elapsed_time": "14:44:25", "remaining_time": "6:25:48"}
|
255 |
+
{"current_steps": 1275, "total_steps": 1824, "loss": 0.4211, "accuracy": 0.9599999785423279, "learning_rate": 5.702156744763784e-08, "epoch": 2.0956607495069033, "percentage": 69.9, "elapsed_time": "14:47:52", "remaining_time": "6:22:18"}
|
256 |
+
{"current_steps": 1280, "total_steps": 1824, "loss": 0.4356, "accuracy": 0.9599999785423279, "learning_rate": 5.607301380278683e-08, "epoch": 2.10387902695595, "percentage": 70.18, "elapsed_time": "14:51:18", "remaining_time": "6:18:48"}
|
257 |
+
{"current_steps": 1285, "total_steps": 1824, "loss": 0.3884, "accuracy": 0.9599999785423279, "learning_rate": 5.513012946906445e-08, "epoch": 2.1120973044049967, "percentage": 70.45, "elapsed_time": "14:54:45", "remaining_time": "6:15:18"}
|
258 |
+
{"current_steps": 1290, "total_steps": 1824, "loss": 0.3565, "accuracy": 0.9900000095367432, "learning_rate": 5.419299199961708e-08, "epoch": 2.1203155818540433, "percentage": 70.72, "elapsed_time": "14:58:12", "remaining_time": "6:11:49"}
|
259 |
+
{"current_steps": 1295, "total_steps": 1824, "loss": 0.391, "accuracy": 0.9599999785423279, "learning_rate": 5.3261678474905785e-08, "epoch": 2.12853385930309, "percentage": 71.0, "elapsed_time": "15:01:39", "remaining_time": "6:08:19"}
|
260 |
+
{"current_steps": 1300, "total_steps": 1824, "loss": 0.3604, "accuracy": 0.9900000095367432, "learning_rate": 5.2336265496366774e-08, "epoch": 2.1367521367521367, "percentage": 71.27, "elapsed_time": "15:05:06", "remaining_time": "6:04:49"}
|
261 |
+
{"current_steps": 1305, "total_steps": 1824, "loss": 0.4611, "accuracy": 0.9700000286102295, "learning_rate": 5.141682918011055e-08, "epoch": 2.1449704142011834, "percentage": 71.55, "elapsed_time": "15:08:33", "remaining_time": "6:01:19"}
|
262 |
+
{"current_steps": 1310, "total_steps": 1824, "loss": 0.3828, "accuracy": 1.0, "learning_rate": 5.0503445150661306e-08, "epoch": 2.15318869165023, "percentage": 71.82, "elapsed_time": "15:11:59", "remaining_time": "5:57:50"}
|
263 |
+
{"current_steps": 1315, "total_steps": 1824, "loss": 0.4158, "accuracy": 0.9700000286102295, "learning_rate": 4.959618853473696e-08, "epoch": 2.1614069690992768, "percentage": 72.09, "elapsed_time": "15:15:29", "remaining_time": "5:54:21"}
|
264 |
+
{"current_steps": 1320, "total_steps": 1824, "loss": 0.429, "accuracy": 0.9599999785423279, "learning_rate": 4.8695133955069564e-08, "epoch": 2.1696252465483234, "percentage": 72.37, "elapsed_time": "15:18:57", "remaining_time": "5:50:52"}
|
265 |
+
{"current_steps": 1325, "total_steps": 1824, "loss": 0.4175, "accuracy": 0.9800000190734863, "learning_rate": 4.780035552426787e-08, "epoch": 2.17784352399737, "percentage": 72.64, "elapsed_time": "15:22:23", "remaining_time": "5:47:22"}
|
266 |
+
{"current_steps": 1330, "total_steps": 1824, "loss": 0.382, "accuracy": 0.9900000095367432, "learning_rate": 4.691192683872129e-08, "epoch": 2.186061801446417, "percentage": 72.92, "elapsed_time": "15:25:50", "remaining_time": "5:43:53"}
|
267 |
+
{"current_steps": 1335, "total_steps": 1824, "loss": 0.3948, "accuracy": 0.9599999785423279, "learning_rate": 4.602992097254646e-08, "epoch": 2.1942800788954635, "percentage": 73.19, "elapsed_time": "15:29:17", "remaining_time": "5:40:23"}
|
268 |
+
{"current_steps": 1340, "total_steps": 1824, "loss": 0.4279, "accuracy": 0.9700000286102295, "learning_rate": 4.515441047157707e-08, "epoch": 2.20249835634451, "percentage": 73.46, "elapsed_time": "15:32:43", "remaining_time": "5:36:53"}
|
269 |
+
{"current_steps": 1345, "total_steps": 1824, "loss": 0.3393, "accuracy": 0.9900000095367432, "learning_rate": 4.428546734739666e-08, "epoch": 2.210716633793557, "percentage": 73.74, "elapsed_time": "15:36:09", "remaining_time": "5:33:23"}
|
270 |
+
{"current_steps": 1350, "total_steps": 1824, "loss": 0.4169, "accuracy": 0.9599999785423279, "learning_rate": 4.342316307141568e-08, "epoch": 2.2189349112426036, "percentage": 74.01, "elapsed_time": "15:39:35", "remaining_time": "5:29:54"}
|
271 |
+
{"current_steps": 1355, "total_steps": 1824, "loss": 0.3688, "accuracy": 0.9800000190734863, "learning_rate": 4.256756856899299e-08, "epoch": 2.2271531886916502, "percentage": 74.29, "elapsed_time": "15:43:02", "remaining_time": "5:26:24"}
|
272 |
+
{"current_steps": 1360, "total_steps": 1824, "loss": 0.4039, "accuracy": 0.9599999785423279, "learning_rate": 4.171875421360202e-08, "epoch": 2.235371466140697, "percentage": 74.56, "elapsed_time": "15:46:28", "remaining_time": "5:22:54"}
|
273 |
+
{"current_steps": 1365, "total_steps": 1824, "loss": 0.3941, "accuracy": 0.9599999785423279, "learning_rate": 4.0876789821042606e-08, "epoch": 2.2435897435897436, "percentage": 74.84, "elapsed_time": "15:49:54", "remaining_time": "5:19:25"}
|
274 |
+
{"current_steps": 1370, "total_steps": 1824, "loss": 0.4133, "accuracy": 0.9800000190734863, "learning_rate": 4.0041744643698585e-08, "epoch": 2.2518080210387903, "percentage": 75.11, "elapsed_time": "15:53:20", "remaining_time": "5:15:55"}
|
275 |
+
{"current_steps": 1375, "total_steps": 1824, "loss": 0.3827, "accuracy": 0.9900000095367432, "learning_rate": 3.9213687364841514e-08, "epoch": 2.260026298487837, "percentage": 75.38, "elapsed_time": "15:56:47", "remaining_time": "5:12:26"}
|
276 |
+
{"current_steps": 1380, "total_steps": 1824, "loss": 0.3713, "accuracy": 0.9700000286102295, "learning_rate": 3.8392686092981716e-08, "epoch": 2.2682445759368837, "percentage": 75.66, "elapsed_time": "16:00:15", "remaining_time": "5:08:57"}
|
277 |
+
{"current_steps": 1385, "total_steps": 1824, "loss": 0.3984, "accuracy": 0.9800000190734863, "learning_rate": 3.757880835626601e-08, "epoch": 2.2764628533859304, "percentage": 75.93, "elapsed_time": "16:03:41", "remaining_time": "5:05:27"}
|
278 |
+
{"current_steps": 1390, "total_steps": 1824, "loss": 0.4114, "accuracy": 1.0, "learning_rate": 3.677212109692364e-08, "epoch": 2.284681130834977, "percentage": 76.21, "elapsed_time": "16:07:08", "remaining_time": "5:01:58"}
|
279 |
+
{"current_steps": 1395, "total_steps": 1824, "loss": 0.3695, "accuracy": 0.9700000286102295, "learning_rate": 3.597269066576017e-08, "epoch": 2.2928994082840237, "percentage": 76.48, "elapsed_time": "16:10:35", "remaining_time": "4:58:29"}
|
280 |
+
{"current_steps": 1400, "total_steps": 1824, "loss": 0.405, "accuracy": 1.0, "learning_rate": 3.518058281669996e-08, "epoch": 2.3011176857330704, "percentage": 76.75, "elapsed_time": "16:14:01", "remaining_time": "4:54:59"}
|
281 |
+
{"current_steps": 1405, "total_steps": 1824, "loss": 0.382, "accuracy": 0.9800000190734863, "learning_rate": 3.439586270137797e-08, "epoch": 2.309335963182117, "percentage": 77.03, "elapsed_time": "16:17:27", "remaining_time": "4:51:30"}
|
282 |
+
{"current_steps": 1410, "total_steps": 1824, "loss": 0.3468, "accuracy": 0.9800000190734863, "learning_rate": 3.3618594863780993e-08, "epoch": 2.3175542406311638, "percentage": 77.3, "elapsed_time": "16:20:53", "remaining_time": "4:48:00"}
|
283 |
+
{"current_steps": 1415, "total_steps": 1824, "loss": 0.36, "accuracy": 1.0, "learning_rate": 3.2848843234938694e-08, "epoch": 2.3257725180802105, "percentage": 77.58, "elapsed_time": "16:24:18", "remaining_time": "4:44:30"}
|
284 |
+
{"current_steps": 1420, "total_steps": 1824, "loss": 0.3933, "accuracy": 0.9800000190734863, "learning_rate": 3.208667112766529e-08, "epoch": 2.333990795529257, "percentage": 77.85, "elapsed_time": "16:27:44", "remaining_time": "4:41:01"}
|
285 |
+
{"current_steps": 1425, "total_steps": 1824, "loss": 0.3954, "accuracy": 0.9900000095367432, "learning_rate": 3.1332141231352194e-08, "epoch": 2.342209072978304, "percentage": 78.12, "elapsed_time": "16:31:11", "remaining_time": "4:37:31"}
|
286 |
+
{"current_steps": 1430, "total_steps": 1824, "loss": 0.3363, "accuracy": 0.9800000190734863, "learning_rate": 3.058531560681141e-08, "epoch": 2.3504273504273505, "percentage": 78.4, "elapsed_time": "16:34:38", "remaining_time": "4:34:02"}
|
287 |
+
{"current_steps": 1435, "total_steps": 1824, "loss": 0.4029, "accuracy": 0.9800000190734863, "learning_rate": 2.984625568117129e-08, "epoch": 2.358645627876397, "percentage": 78.67, "elapsed_time": "16:38:04", "remaining_time": "4:30:33"}
|
288 |
+
{"current_steps": 1440, "total_steps": 1824, "loss": 0.3968, "accuracy": 0.9800000190734863, "learning_rate": 2.9115022242823862e-08, "epoch": 2.366863905325444, "percentage": 78.95, "elapsed_time": "16:41:30", "remaining_time": "4:27:04"}
|
289 |
+
{"current_steps": 1445, "total_steps": 1824, "loss": 0.4211, "accuracy": 0.9900000095367432, "learning_rate": 2.839167543642511e-08, "epoch": 2.3750821827744906, "percentage": 79.22, "elapsed_time": "16:44:57", "remaining_time": "4:23:35"}
|
290 |
+
{"current_steps": 1450, "total_steps": 1824, "loss": 0.3838, "accuracy": 0.9800000190734863, "learning_rate": 2.7676274757947816e-08, "epoch": 2.3833004602235373, "percentage": 79.5, "elapsed_time": "16:48:24", "remaining_time": "4:20:06"}
|
291 |
+
{"current_steps": 1455, "total_steps": 1824, "loss": 0.4051, "accuracy": 0.949999988079071, "learning_rate": 2.696887904978819e-08, "epoch": 2.391518737672584, "percentage": 79.77, "elapsed_time": "16:51:51", "remaining_time": "4:16:36"}
|
292 |
+
{"current_steps": 1460, "total_steps": 1824, "loss": 0.4246, "accuracy": 0.9700000286102295, "learning_rate": 2.6269546495925886e-08, "epoch": 2.3997370151216306, "percentage": 80.04, "elapsed_time": "16:55:18", "remaining_time": "4:13:07"}
|
293 |
+
{"current_steps": 1465, "total_steps": 1824, "loss": 0.3833, "accuracy": 0.9599999785423279, "learning_rate": 2.5578334617138236e-08, "epoch": 2.4079552925706773, "percentage": 80.32, "elapsed_time": "16:58:45", "remaining_time": "4:09:38"}
|
294 |
+
{"current_steps": 1470, "total_steps": 1824, "loss": 0.379, "accuracy": 0.9900000095367432, "learning_rate": 2.489530026626932e-08, "epoch": 2.416173570019724, "percentage": 80.59, "elapsed_time": "17:02:13", "remaining_time": "4:06:10"}
|
295 |
+
{"current_steps": 1475, "total_steps": 1824, "loss": 0.3486, "accuracy": 0.9900000095367432, "learning_rate": 2.422049962355366e-08, "epoch": 2.4243918474687707, "percentage": 80.87, "elapsed_time": "17:05:39", "remaining_time": "4:02:40"}
|
296 |
+
{"current_steps": 1480, "total_steps": 1824, "loss": 0.3744, "accuracy": 0.9700000286102295, "learning_rate": 2.3553988191995208e-08, "epoch": 2.4326101249178174, "percentage": 81.14, "elapsed_time": "17:09:05", "remaining_time": "3:59:11"}
|
297 |
+
{"current_steps": 1485, "total_steps": 1824, "loss": 0.3695, "accuracy": 0.9800000190734863, "learning_rate": 2.2895820792802474e-08, "epoch": 2.440828402366864, "percentage": 81.41, "elapsed_time": "17:12:32", "remaining_time": "3:55:42"}
|
298 |
+
{"current_steps": 1490, "total_steps": 1824, "loss": 0.4179, "accuracy": 0.9599999785423279, "learning_rate": 2.2246051560879095e-08, "epoch": 2.4490466798159107, "percentage": 81.69, "elapsed_time": "17:15:59", "remaining_time": "3:52:13"}
|
299 |
+
{"current_steps": 1495, "total_steps": 1824, "loss": 0.4504, "accuracy": 0.9800000190734863, "learning_rate": 2.160473394037149e-08, "epoch": 2.4572649572649574, "percentage": 81.96, "elapsed_time": "17:19:26", "remaining_time": "3:48:44"}
|
300 |
+
{"current_steps": 1500, "total_steps": 1824, "loss": 0.3262, "accuracy": 0.9800000190734863, "learning_rate": 2.097192068027276e-08, "epoch": 2.465483234714004, "percentage": 82.24, "elapsed_time": "17:22:53", "remaining_time": "3:45:15"}
|
301 |
+
{"current_steps": 1505, "total_steps": 1824, "loss": 0.3978, "accuracy": 0.9900000095367432, "learning_rate": 2.0347663830084182e-08, "epoch": 2.473701512163051, "percentage": 82.51, "elapsed_time": "17:26:19", "remaining_time": "3:41:46"}
|
302 |
+
{"current_steps": 1510, "total_steps": 1824, "loss": 0.4156, "accuracy": 0.9700000286102295, "learning_rate": 1.9732014735534168e-08, "epoch": 2.4819197896120975, "percentage": 82.79, "elapsed_time": "17:29:46", "remaining_time": "3:38:17"}
|
303 |
+
{"current_steps": 1515, "total_steps": 1824, "loss": 0.351, "accuracy": 0.9599999785423279, "learning_rate": 1.9125024034354758e-08, "epoch": 2.490138067061144, "percentage": 83.06, "elapsed_time": "17:33:13", "remaining_time": "3:34:48"}
|
304 |
+
{"current_steps": 1520, "total_steps": 1824, "loss": 0.3733, "accuracy": 0.9800000190734863, "learning_rate": 1.85267416521169e-08, "epoch": 2.498356344510191, "percentage": 83.33, "elapsed_time": "17:36:41", "remaining_time": "3:31:20"}
|
305 |
+
{"current_steps": 1525, "total_steps": 1824, "loss": 0.3857, "accuracy": 0.9700000286102295, "learning_rate": 1.793721679812389e-08, "epoch": 2.5065746219592375, "percentage": 83.61, "elapsed_time": "17:40:07", "remaining_time": "3:27:51"}
|
306 |
+
{"current_steps": 1530, "total_steps": 1824, "loss": 0.3883, "accuracy": 0.9300000071525574, "learning_rate": 1.735649796136382e-08, "epoch": 2.5147928994082838, "percentage": 83.88, "elapsed_time": "17:43:36", "remaining_time": "3:24:22"}
|
307 |
+
{"current_steps": 1535, "total_steps": 1824, "loss": 0.3626, "accuracy": 0.9800000190734863, "learning_rate": 1.678463290652142e-08, "epoch": 2.523011176857331, "percentage": 84.16, "elapsed_time": "17:47:05", "remaining_time": "3:20:54"}
|
308 |
+
{"current_steps": 1540, "total_steps": 1824, "loss": 0.3481, "accuracy": 0.9900000095367432, "learning_rate": 1.6221668670049315e-08, "epoch": 2.531229454306377, "percentage": 84.43, "elapsed_time": "17:50:34", "remaining_time": "3:17:25"}
|
309 |
+
{"current_steps": 1545, "total_steps": 1824, "loss": 0.3531, "accuracy": 0.9800000190734863, "learning_rate": 1.5667651556299178e-08, "epoch": 2.5394477317554243, "percentage": 84.7, "elapsed_time": "17:54:02", "remaining_time": "3:13:57"}
|
310 |
+
{"current_steps": 1550, "total_steps": 1824, "loss": 0.3849, "accuracy": 0.9800000190734863, "learning_rate": 1.5122627133713262e-08, "epoch": 2.5476660092044705, "percentage": 84.98, "elapsed_time": "17:57:30", "remaining_time": "3:10:28"}
|
311 |
+
{"current_steps": 1555, "total_steps": 1824, "loss": 0.3699, "accuracy": 0.9399999976158142, "learning_rate": 1.4586640231076226e-08, "epoch": 2.5558842866535176, "percentage": 85.25, "elapsed_time": "18:00:58", "remaining_time": "3:06:59"}
|
312 |
+
{"current_steps": 1560, "total_steps": 1824, "loss": 0.3552, "accuracy": 0.9700000286102295, "learning_rate": 1.405973493382806e-08, "epoch": 2.564102564102564, "percentage": 85.53, "elapsed_time": "18:04:26", "remaining_time": "3:03:31"}
|
313 |
+
{"current_steps": 1565, "total_steps": 1824, "loss": 0.3254, "accuracy": 0.9800000190734863, "learning_rate": 1.3541954580437941e-08, "epoch": 2.572320841551611, "percentage": 85.8, "elapsed_time": "18:07:54", "remaining_time": "3:00:02"}
|
314 |
+
{"current_steps": 1570, "total_steps": 1824, "loss": 0.4055, "accuracy": 0.9800000190734863, "learning_rate": 1.3033341758839592e-08, "epoch": 2.5805391190006572, "percentage": 86.07, "elapsed_time": "18:11:23", "remaining_time": "2:56:34"}
|
315 |
+
{"current_steps": 1575, "total_steps": 1824, "loss": 0.3683, "accuracy": 0.9900000095367432, "learning_rate": 1.2533938302928329e-08, "epoch": 2.5887573964497044, "percentage": 86.35, "elapsed_time": "18:14:51", "remaining_time": "2:53:05"}
|
316 |
+
{"current_steps": 1580, "total_steps": 1824, "loss": 0.378, "accuracy": 0.9599999785423279, "learning_rate": 1.2043785289120409e-08, "epoch": 2.5969756738987506, "percentage": 86.62, "elapsed_time": "18:18:19", "remaining_time": "2:49:36"}
|
317 |
+
{"current_steps": 1585, "total_steps": 1824, "loss": 0.3656, "accuracy": 0.9800000190734863, "learning_rate": 1.1562923032974125e-08, "epoch": 2.6051939513477977, "percentage": 86.9, "elapsed_time": "18:21:48", "remaining_time": "2:46:08"}
|
318 |
+
{"current_steps": 1590, "total_steps": 1824, "loss": 0.3909, "accuracy": 0.9800000190734863, "learning_rate": 1.1091391085874161e-08, "epoch": 2.613412228796844, "percentage": 87.17, "elapsed_time": "18:25:15", "remaining_time": "2:42:39"}
|
319 |
+
{"current_steps": 1595, "total_steps": 1824, "loss": 0.3818, "accuracy": 0.9900000095367432, "learning_rate": 1.06292282317781e-08, "epoch": 2.621630506245891, "percentage": 87.45, "elapsed_time": "18:28:43", "remaining_time": "2:39:11"}
|
320 |
+
{"current_steps": 1600, "total_steps": 1824, "loss": 0.4384, "accuracy": 0.9700000286102295, "learning_rate": 1.017647248402674e-08, "epoch": 2.6298487836949374, "percentage": 87.72, "elapsed_time": "18:32:13", "remaining_time": "2:35:42"}
|
321 |
+
{"current_steps": 1605, "total_steps": 1824, "loss": 0.4032, "accuracy": 0.9800000190734863, "learning_rate": 9.733161082217223e-09, "epoch": 2.6380670611439845, "percentage": 87.99, "elapsed_time": "18:35:42", "remaining_time": "2:32:14"}
|
322 |
+
{"current_steps": 1610, "total_steps": 1824, "loss": 0.4197, "accuracy": 0.949999988079071, "learning_rate": 9.299330489140125e-09, "epoch": 2.6462853385930307, "percentage": 88.27, "elapsed_time": "18:39:10", "remaining_time": "2:28:45"}
|
323 |
+
{"current_steps": 1615, "total_steps": 1824, "loss": 0.4112, "accuracy": 0.949999988079071, "learning_rate": 8.87501638778039e-09, "epoch": 2.654503616042078, "percentage": 88.54, "elapsed_time": "18:42:38", "remaining_time": "2:25:17"}
|
324 |
+
{"current_steps": 1620, "total_steps": 1824, "loss": 0.3553, "accuracy": 0.9700000286102295, "learning_rate": 8.460253678382296e-09, "epoch": 2.662721893491124, "percentage": 88.82, "elapsed_time": "18:46:06", "remaining_time": "2:21:48"}
|
325 |
+
{"current_steps": 1625, "total_steps": 1824, "loss": 0.3922, "accuracy": 0.9900000095367432, "learning_rate": 8.055076475578918e-09, "epoch": 2.6709401709401708, "percentage": 89.09, "elapsed_time": "18:49:35", "remaining_time": "2:18:19"}
|
326 |
+
{"current_steps": 1630, "total_steps": 1824, "loss": 0.3539, "accuracy": 0.9599999785423279, "learning_rate": 7.659518105586238e-09, "epoch": 2.6791584483892175, "percentage": 89.36, "elapsed_time": "18:53:02", "remaining_time": "2:14:51"}
|
327 |
+
{"current_steps": 1635, "total_steps": 1824, "loss": 0.3316, "accuracy": 0.9800000190734863, "learning_rate": 7.273611103461836e-09, "epoch": 2.687376725838264, "percentage": 89.64, "elapsed_time": "18:56:31", "remaining_time": "2:11:22"}
|
328 |
+
{"current_steps": 1640, "total_steps": 1824, "loss": 0.4056, "accuracy": 0.9800000190734863, "learning_rate": 6.897387210429067e-09, "epoch": 2.695595003287311, "percentage": 89.91, "elapsed_time": "18:59:59", "remaining_time": "2:07:54"}
|
329 |
+
{"current_steps": 1645, "total_steps": 1824, "loss": 0.3542, "accuracy": 0.9800000190734863, "learning_rate": 6.530877371266175e-09, "epoch": 2.7038132807363575, "percentage": 90.19, "elapsed_time": "19:03:26", "remaining_time": "2:04:25"}
|
330 |
+
{"current_steps": 1650, "total_steps": 1824, "loss": 0.4291, "accuracy": 0.9700000286102295, "learning_rate": 6.1741117317611196e-09, "epoch": 2.712031558185404, "percentage": 90.46, "elapsed_time": "19:06:55", "remaining_time": "2:00:56"}
|
331 |
+
{"current_steps": 1655, "total_steps": 1824, "loss": 0.4103, "accuracy": 0.9300000071525574, "learning_rate": 5.827119636232017e-09, "epoch": 2.720249835634451, "percentage": 90.73, "elapsed_time": "19:10:24", "remaining_time": "1:57:28"}
|
332 |
+
{"current_steps": 1660, "total_steps": 1824, "loss": 0.4266, "accuracy": 0.9700000286102295, "learning_rate": 5.489929625113549e-09, "epoch": 2.7284681130834976, "percentage": 91.01, "elapsed_time": "19:13:54", "remaining_time": "1:54:00"}
|
333 |
+
{"current_steps": 1665, "total_steps": 1824, "loss": 0.3332, "accuracy": 0.9900000095367432, "learning_rate": 5.1625694326095506e-09, "epoch": 2.7366863905325443, "percentage": 91.28, "elapsed_time": "19:17:21", "remaining_time": "1:50:31"}
|
334 |
+
{"current_steps": 1670, "total_steps": 1824, "loss": 0.357, "accuracy": 0.9599999785423279, "learning_rate": 4.845065984411742e-09, "epoch": 2.744904667981591, "percentage": 91.56, "elapsed_time": "19:20:53", "remaining_time": "1:47:03"}
|
335 |
+
{"current_steps": 1675, "total_steps": 1824, "loss": 0.3677, "accuracy": 0.9700000286102295, "learning_rate": 4.5374453954851035e-09, "epoch": 2.7531229454306376, "percentage": 91.83, "elapsed_time": "19:24:22", "remaining_time": "1:43:34"}
|
336 |
+
{"current_steps": 1680, "total_steps": 1824, "loss": 0.3946, "accuracy": 0.9900000095367432, "learning_rate": 4.239732967919976e-09, "epoch": 2.7613412228796843, "percentage": 92.11, "elapsed_time": "19:27:52", "remaining_time": "1:40:06"}
|
337 |
+
{"current_steps": 1685, "total_steps": 1824, "loss": 0.3834, "accuracy": 0.9800000190734863, "learning_rate": 3.951953188850762e-09, "epoch": 2.769559500328731, "percentage": 92.38, "elapsed_time": "19:31:32", "remaining_time": "1:36:38"}
|
338 |
+
{"current_steps": 1690, "total_steps": 1824, "loss": 0.3877, "accuracy": 0.9599999785423279, "learning_rate": 3.674129728442013e-09, "epoch": 2.7777777777777777, "percentage": 92.65, "elapsed_time": "19:35:17", "remaining_time": "1:33:11"}
|
339 |
+
{"current_steps": 1695, "total_steps": 1824, "loss": 0.3607, "accuracy": 0.9800000190734863, "learning_rate": 3.4062854379414694e-09, "epoch": 2.7859960552268244, "percentage": 92.93, "elapsed_time": "19:39:03", "remaining_time": "1:29:43"}
|
340 |
+
{"current_steps": 1700, "total_steps": 1824, "loss": 0.4297, "accuracy": 0.9700000286102295, "learning_rate": 3.1484423478004563e-09, "epoch": 2.794214332675871, "percentage": 93.2, "elapsed_time": "19:42:47", "remaining_time": "1:26:16"}
|
341 |
+
{"current_steps": 1705, "total_steps": 1824, "loss": 0.399, "accuracy": 0.9700000286102295, "learning_rate": 2.9006216658619687e-09, "epoch": 2.8024326101249177, "percentage": 93.48, "elapsed_time": "19:46:34", "remaining_time": "1:22:48"}
|
342 |
+
{"current_steps": 1710, "total_steps": 1824, "loss": 0.3473, "accuracy": 0.9700000286102295, "learning_rate": 2.6628437756162635e-09, "epoch": 2.8106508875739644, "percentage": 93.75, "elapsed_time": "19:50:20", "remaining_time": "1:19:21"}
|
343 |
+
{"current_steps": 1715, "total_steps": 1824, "loss": 0.4067, "accuracy": 0.9800000190734863, "learning_rate": 2.435128234524228e-09, "epoch": 2.818869165023011, "percentage": 94.02, "elapsed_time": "19:54:04", "remaining_time": "1:15:53"}
|
344 |
+
{"current_steps": 1720, "total_steps": 1824, "loss": 0.4069, "accuracy": 0.9200000166893005, "learning_rate": 2.2174937724088877e-09, "epoch": 2.827087442472058, "percentage": 94.3, "elapsed_time": "19:57:49", "remaining_time": "1:12:25"}
|
345 |
+
{"current_steps": 1725, "total_steps": 1824, "loss": 0.3451, "accuracy": 0.9700000286102295, "learning_rate": 2.009958289914765e-09, "epoch": 2.8353057199211045, "percentage": 94.57, "elapsed_time": "20:01:33", "remaining_time": "1:08:57"}
|
346 |
+
{"current_steps": 1730, "total_steps": 1824, "loss": 0.3337, "accuracy": 0.9900000095367432, "learning_rate": 1.8125388570355422e-09, "epoch": 2.843523997370151, "percentage": 94.85, "elapsed_time": "20:05:15", "remaining_time": "1:05:29"}
|
347 |
+
{"current_steps": 1735, "total_steps": 1824, "loss": 0.4137, "accuracy": 0.9700000286102295, "learning_rate": 1.6252517117101017e-09, "epoch": 2.851742274819198, "percentage": 95.12, "elapsed_time": "20:08:59", "remaining_time": "1:02:01"}
|
348 |
+
{"current_steps": 1740, "total_steps": 1824, "loss": 0.4201, "accuracy": 1.0, "learning_rate": 1.4481122584868582e-09, "epoch": 2.8599605522682445, "percentage": 95.39, "elapsed_time": "20:12:43", "remaining_time": "0:58:32"}
|
349 |
+
{"current_steps": 1745, "total_steps": 1824, "loss": 0.4267, "accuracy": 0.9700000286102295, "learning_rate": 1.2811350672568138e-09, "epoch": 2.868178829717291, "percentage": 95.67, "elapsed_time": "20:16:28", "remaining_time": "0:55:04"}
|
350 |
+
{"current_steps": 1750, "total_steps": 1824, "loss": 0.4018, "accuracy": 0.9599999785423279, "learning_rate": 1.1243338720550445e-09, "epoch": 2.876397107166338, "percentage": 95.94, "elapsed_time": "20:20:15", "remaining_time": "0:51:35"}
|
351 |
+
{"current_steps": 1755, "total_steps": 1824, "loss": 0.3855, "accuracy": 0.9599999785423279, "learning_rate": 9.777215699311725e-10, "epoch": 2.8846153846153846, "percentage": 96.22, "elapsed_time": "20:24:02", "remaining_time": "0:48:07"}
|
352 |
+
{"current_steps": 1760, "total_steps": 1824, "loss": 0.4478, "accuracy": 1.0, "learning_rate": 8.413102198885358e-10, "epoch": 2.8928336620644313, "percentage": 96.49, "elapsed_time": "20:27:51", "remaining_time": "0:44:38"}
|
353 |
+
{"current_steps": 1765, "total_steps": 1824, "loss": 0.3988, "accuracy": 0.9900000095367432, "learning_rate": 7.151110418923134e-10, "epoch": 2.901051939513478, "percentage": 96.77, "elapsed_time": "20:31:24", "remaining_time": "0:41:09"}
|
354 |
+
{"current_steps": 1770, "total_steps": 1824, "loss": 0.352, "accuracy": 0.949999988079071, "learning_rate": 5.991344159466672e-10, "epoch": 2.9092702169625246, "percentage": 97.04, "elapsed_time": "20:35:00", "remaining_time": "0:37:40"}
|
355 |
+
{"current_steps": 1775, "total_steps": 1824, "loss": 0.3936, "accuracy": 0.9800000190734863, "learning_rate": 4.933898812409937e-10, "epoch": 2.9174884944115713, "percentage": 97.31, "elapsed_time": "20:38:35", "remaining_time": "0:34:11"}
|
356 |
+
{"current_steps": 1780, "total_steps": 1824, "loss": 0.4187, "accuracy": 0.949999988079071, "learning_rate": 3.978861353653301e-10, "epoch": 2.925706771860618, "percentage": 97.59, "elapsed_time": "20:42:05", "remaining_time": "0:30:42"}
|
357 |
+
{"current_steps": 1785, "total_steps": 1824, "loss": 0.3632, "accuracy": 0.9399999976158142, "learning_rate": 3.1263103359494005e-10, "epoch": 2.9339250493096647, "percentage": 97.86, "elapsed_time": "20:45:39", "remaining_time": "0:27:12"}
|
358 |
+
{"current_steps": 1790, "total_steps": 1824, "loss": 0.3455, "accuracy": 1.0, "learning_rate": 2.3763158824419147e-10, "epoch": 2.9421433267587114, "percentage": 98.14, "elapsed_time": "20:49:10", "remaining_time": "0:23:43"}
|
359 |
+
{"current_steps": 1795, "total_steps": 1824, "loss": 0.367, "accuracy": 0.9900000095367432, "learning_rate": 1.728939680898517e-10, "epoch": 2.950361604207758, "percentage": 98.41, "elapsed_time": "20:52:38", "remaining_time": "0:20:14"}
|
360 |
+
{"current_steps": 1800, "total_steps": 1824, "loss": 0.3921, "accuracy": 0.9599999785423279, "learning_rate": 1.184234978636456e-10, "epoch": 2.9585798816568047, "percentage": 98.68, "elapsed_time": "20:56:06", "remaining_time": "0:16:44"}
|
361 |
+
{"current_steps": 1805, "total_steps": 1824, "loss": 0.3843, "accuracy": 0.9700000286102295, "learning_rate": 7.422465781431464e-11, "epoch": 2.9667981591058514, "percentage": 98.96, "elapsed_time": "20:59:34", "remaining_time": "0:13:15"}
|
362 |
+
{"current_steps": 1810, "total_steps": 1824, "loss": 0.3819, "accuracy": 0.9700000286102295, "learning_rate": 4.030108333910598e-11, "epoch": 2.975016436554898, "percentage": 99.23, "elapsed_time": "21:03:01", "remaining_time": "0:09:46"}
|
363 |
+
{"current_steps": 1815, "total_steps": 1824, "loss": 0.372, "accuracy": 0.949999988079071, "learning_rate": 1.6655564684747713e-11, "epoch": 2.983234714003945, "percentage": 99.51, "elapsed_time": "21:06:29", "remaining_time": "0:06:16"}
|
364 |
+
{"current_steps": 1820, "total_steps": 1824, "loss": 0.3871, "accuracy": 0.9800000190734863, "learning_rate": 3.290046717979722e-12, "epoch": 2.9914529914529915, "percentage": 99.78, "elapsed_time": "21:10:00", "remaining_time": "0:02:47"}
|
365 |
+
{"current_steps": 1824, "total_steps": 1824, "epoch": 2.998027613412229, "percentage": 100.0, "elapsed_time": "21:13:52", "remaining_time": "0:00:00"}
|
trainer_state.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a28297f45322d62c967bfceac3c65a44a0da991766271a3fdc82f1ca61fa4a63
|
3 |
+
size 7032
|