project-llm-trainer 0.5.9__py3-none-any.whl → 0.5.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of project-llm-trainer might be problematic. Click here for more details.
- llm_trainer/checkpoint.py +6 -5
- llm_trainer/eval.py +7 -2
- {project_llm_trainer-0.5.9.dist-info → project_llm_trainer-0.5.11.dist-info}/METADATA +1 -1
- {project_llm_trainer-0.5.9.dist-info → project_llm_trainer-0.5.11.dist-info}/RECORD +13 -13
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/calc_intermediate_size +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/ddp_train +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/ds_train +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/plot_loss +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/plot_lr +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/py_train +0 -0
- {project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/smart_train +0 -0
- {project_llm_trainer-0.5.9.dist-info → project_llm_trainer-0.5.11.dist-info}/WHEEL +0 -0
- {project_llm_trainer-0.5.9.dist-info → project_llm_trainer-0.5.11.dist-info}/top_level.txt +0 -0
llm_trainer/checkpoint.py
CHANGED
|
@@ -81,12 +81,13 @@ def load_checkpoint(
|
|
|
81
81
|
else:
|
|
82
82
|
checkpoint_name = os.environ.get('CHECKPOINT_NAME', DEFAULT_CHECKPOINT_NAME)
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
if os.path.exists(checkpoint_name):
|
|
85
|
+
state_dict = torch.load(checkpoint_name, weights_only=True, map_location=device)
|
|
86
|
+
raw_model = model.module if isinstance(model, DDP) else model
|
|
87
|
+
raw_model.load_state_dict(state_dict['model_state_dict'])
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
if optimizer:
|
|
90
|
+
optimizer.load_state_dict(state_dict['optim_state_dict'])
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
def load_checkpoint_for_eval(
|
llm_trainer/eval.py
CHANGED
|
@@ -15,12 +15,17 @@ def submit_gen_task(
|
|
|
15
15
|
tokens_per_image
|
|
16
16
|
):
|
|
17
17
|
log_dir = get_log_dir()
|
|
18
|
+
tokens = TrainerTools().tokenizer.encode(prompt, unsqueeze=True, covert_tensor=True)
|
|
19
|
+
|
|
20
|
+
max_new_tokens = eval_config.max_new_tokens
|
|
21
|
+
if not max_new_tokens:
|
|
22
|
+
max_new_tokens = max_position_embeddings - tokens.shape[-1]
|
|
18
23
|
|
|
19
24
|
gen_result = generate(
|
|
20
25
|
eval_model,
|
|
21
|
-
prompt=
|
|
26
|
+
prompt=tokens,
|
|
22
27
|
max_position_embeddings=max_position_embeddings,
|
|
23
|
-
max_new_tokens=
|
|
28
|
+
max_new_tokens=max_new_tokens,
|
|
24
29
|
temperature=eval_config.temperature,
|
|
25
30
|
k=eval_config.top_k,
|
|
26
31
|
p=eval_config.top_p,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
llm_trainer/__init__.py,sha256=HWgtTEVeQSnZmEyYQm2K6eFEG4X2QAoigMlB5Z2tcXE,260
|
|
2
|
-
llm_trainer/checkpoint.py,sha256=
|
|
2
|
+
llm_trainer/checkpoint.py,sha256=Wh5CwceIajTgJ9i_mH3I1R9N2nOLFqVFmlEMkTiGcD4,4306
|
|
3
3
|
llm_trainer/dataset.py,sha256=4QlOo0SFB5816BUYegQjgobUqTUMQvdmZMM_OEAMSjE,4347
|
|
4
4
|
llm_trainer/dpo_trainer.py,sha256=1A_4QP2_xqM_YeqdXy-0RaMvEL80gim-pgnPQyHww9U,12052
|
|
5
5
|
llm_trainer/ds_checkpoint.py,sha256=D092fkS1Up4QmpV9YCpqbSzfX_caCAeX-UiOrhOE1I8,1947
|
|
6
|
-
llm_trainer/eval.py,sha256=
|
|
6
|
+
llm_trainer/eval.py,sha256=ZyUfSo2Q8P-lrCdPEnGkoo5pGubd0AabREK5eMISRII,1109
|
|
7
7
|
llm_trainer/generate_utils.py,sha256=wrZoG2g7CsOyG4sb3px9vURHQFV6_9j5kQmpFc5A8yg,15335
|
|
8
8
|
llm_trainer/grpo_trainer.py,sha256=sCYjvksdm9f7TpN23KXuCmua_8VFTZEfVEcflL89P_I,16058
|
|
9
9
|
llm_trainer/log.py,sha256=LxqTGRNZUGMTSQCePRpk-rYyxSnSIbT4kOdP8Fbzr0M,462
|
|
@@ -20,14 +20,14 @@ llm_trainer/tools.py,sha256=yF17lp6oOfLe2XJeKDQ1juZcbv-6vFamJSLwEeArduA,2975
|
|
|
20
20
|
llm_trainer/train_configs.py,sha256=guV8xkG5TSGvYwFvsQV_mA8mDHLLVhL5L0xo_WMsMME,7347
|
|
21
21
|
llm_trainer/trainer.py,sha256=U26dZc22nByfTZUzKeEiqqYVexBzgw0ep7N0Z2zIcWI,26141
|
|
22
22
|
llm_trainer/utils.py,sha256=LWNhyQ0NDEZ9mZtk2Ryvh6EulvHIaUGIflugSpqmeFI,6791
|
|
23
|
-
project_llm_trainer-0.5.
|
|
24
|
-
project_llm_trainer-0.5.
|
|
25
|
-
project_llm_trainer-0.5.
|
|
26
|
-
project_llm_trainer-0.5.
|
|
27
|
-
project_llm_trainer-0.5.
|
|
28
|
-
project_llm_trainer-0.5.
|
|
29
|
-
project_llm_trainer-0.5.
|
|
30
|
-
project_llm_trainer-0.5.
|
|
31
|
-
project_llm_trainer-0.5.
|
|
32
|
-
project_llm_trainer-0.5.
|
|
33
|
-
project_llm_trainer-0.5.
|
|
23
|
+
project_llm_trainer-0.5.11.data/scripts/calc_intermediate_size,sha256=AggpgNHokJiJMbEtVdOnolqr_4bH3i1UYuZNEAzC2Gc,460
|
|
24
|
+
project_llm_trainer-0.5.11.data/scripts/ddp_train,sha256=x81AasaN2-9TwARFFF1l7iV1LmfMQ0bLw0i_CGbOwSw,299
|
|
25
|
+
project_llm_trainer-0.5.11.data/scripts/ds_train,sha256=qL3qc3TcedBCw98UZUjW07ONcErRawLE1HymW2AmscA,265
|
|
26
|
+
project_llm_trainer-0.5.11.data/scripts/plot_loss,sha256=MzFcdJESlVr1srj4Td6-AxPGUKkfB_QEcJwm0Bd-5fU,910
|
|
27
|
+
project_llm_trainer-0.5.11.data/scripts/plot_lr,sha256=w_7XR_x3KYYyboeOVAeu_I4fveLFI-C0wBmRrNlmWUI,894
|
|
28
|
+
project_llm_trainer-0.5.11.data/scripts/py_train,sha256=tOp9TquORQeU8XN5H7OVIk5O0Ypwi34p_GENxTwgwdk,265
|
|
29
|
+
project_llm_trainer-0.5.11.data/scripts/smart_train,sha256=Pmt4Q0to4Hoz82iB9uFPZuz7uahNUbfE7FR1940EBy8,716
|
|
30
|
+
project_llm_trainer-0.5.11.dist-info/METADATA,sha256=RAhT8VLTlO4Oyr9ocDxBvhulYed1JXWX_5GWWkiJ7go,196
|
|
31
|
+
project_llm_trainer-0.5.11.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
32
|
+
project_llm_trainer-0.5.11.dist-info/top_level.txt,sha256=LtRFg28i0QIG7iBCD2t095oSco99LCtkijibS9cMGik,12
|
|
33
|
+
project_llm_trainer-0.5.11.dist-info/RECORD,,
|
{project_llm_trainer-0.5.9.data → project_llm_trainer-0.5.11.data}/scripts/calc_intermediate_size
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|