mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +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:
|
||||
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]
|
||||
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]
|
||||
|
||||
accept_ids = source_ids + accept_ids + [tokenizer.eos_token_id]
|
||||
reject_ids = source_ids + reject_ids + [tokenizer.eos_token_id]
|
||||
accept_ids = source_ids + accept_ids
|
||||
reject_ids = source_ids + reject_ids
|
||||
|
||||
model_inputs["accept_ids"].append(accept_ids)
|
||||
model_inputs["reject_ids"].append(reject_ids)
|
||||
|
@ -388,12 +388,9 @@ register_template(
|
||||
name="intern",
|
||||
prefix=[],
|
||||
prompt=[
|
||||
{"token": "<|User|>"},
|
||||
":{{query}}",
|
||||
"<|User|>:{{query}}",
|
||||
{"token": "<eoh>"},
|
||||
"\n",
|
||||
{"token": "<|Bot|>"},
|
||||
":"
|
||||
"\n<|Bot|>:"
|
||||
],
|
||||
sep=[
|
||||
"\n"
|
||||
|
@ -156,7 +156,7 @@ class Runner:
|
||||
else:
|
||||
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]
|
||||
else:
|
||||
finish_info = ALERTS["err_failed"][lang]
|
||||
|
Loading…
x
Reference in New Issue
Block a user