mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-15 08:08:09 +08:00
Former-commit-id: 70ea3caaa7a7695c77179cd1bb18707a80a373d7
This commit is contained in:
parent
031a819257
commit
a3a7465f00
@ -103,13 +103,13 @@ def preprocess_dataset(
|
|||||||
|
|
||||||
if len(source_ids) > data_args.max_source_length:
|
if len(source_ids) > data_args.max_source_length:
|
||||||
source_ids = source_ids[:data_args.max_source_length]
|
source_ids = source_ids[:data_args.max_source_length]
|
||||||
if len(accept_ids) > data_args.max_target_length - 1: # eos token
|
if len(accept_ids) > data_args.max_target_length:
|
||||||
accept_ids = accept_ids[:data_args.max_target_length - 1]
|
accept_ids = accept_ids[:data_args.max_target_length - 1]
|
||||||
if len(reject_ids) > data_args.max_target_length - 1: # eos token
|
if len(reject_ids) > data_args.max_target_length:
|
||||||
reject_ids = reject_ids[:data_args.max_target_length - 1]
|
reject_ids = reject_ids[:data_args.max_target_length - 1]
|
||||||
|
|
||||||
accept_ids = source_ids + accept_ids + [tokenizer.eos_token_id]
|
accept_ids = source_ids + accept_ids
|
||||||
reject_ids = source_ids + reject_ids + [tokenizer.eos_token_id]
|
reject_ids = source_ids + reject_ids
|
||||||
|
|
||||||
model_inputs["accept_ids"].append(accept_ids)
|
model_inputs["accept_ids"].append(accept_ids)
|
||||||
model_inputs["reject_ids"].append(reject_ids)
|
model_inputs["reject_ids"].append(reject_ids)
|
||||||
|
@ -388,12 +388,9 @@ register_template(
|
|||||||
name="intern",
|
name="intern",
|
||||||
prefix=[],
|
prefix=[],
|
||||||
prompt=[
|
prompt=[
|
||||||
{"token": "<|User|>"},
|
"<|User|>:{{query}}",
|
||||||
":{{query}}",
|
|
||||||
{"token": "<eoh>"},
|
{"token": "<eoh>"},
|
||||||
"\n",
|
"\n<|Bot|>:"
|
||||||
{"token": "<|Bot|>"},
|
|
||||||
":"
|
|
||||||
],
|
],
|
||||||
sep=[
|
sep=[
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -156,7 +156,7 @@ class Runner:
|
|||||||
else:
|
else:
|
||||||
yield format_info(logger_handler.log, trainer_callback)
|
yield format_info(logger_handler.log, trainer_callback)
|
||||||
|
|
||||||
if os.path.exists(os.path.join(output_dir), TRAINING_ARGS_NAME):
|
if os.path.exists(os.path.join(output_dir, TRAINING_ARGS_NAME)):
|
||||||
finish_info = ALERTS["info_finished"][lang]
|
finish_info = ALERTS["info_finished"][lang]
|
||||||
else:
|
else:
|
||||||
finish_info = ALERTS["err_failed"][lang]
|
finish_info = ALERTS["err_failed"][lang]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user