Dataset is now directly tokenized to avoid further post-processing of the trainer; locCustomPromptTemplate to specify a custom Jinja template; showChatTemplate for debugging;

This commit is contained in:
extio-de
2024-12-26 21:42:59 +01:00
parent cb9e62dbac
commit 63192f2bc0
5 changed files with 26 additions and 6 deletions

View File

@@ -3,6 +3,8 @@
device=cuda:0
# purge existing workdir, adapters and full output when the program starts
purgeTargetDirectories=false
# For debugging
showChatTemplate=true
[Trainer]
# activate trainer
@@ -10,13 +12,15 @@ train=true
# save lora adapter to disk after training. Also required for validation and merging
storeAdapter=true
# path to base model (hf safetensors repo)
locBaseModel=../../lm/models/safetensors/Qwen2.5-1.5B-Instruct/
locBaseModel=../../lm/models/safetensors/Llama-3.2-3B-Instruct-uncensored/
# path to datasets
locDataset=./testProject/dataset/
# path: working directory
locWorkdir=./testProject/work/
# path: lora adapter output
locAdapter=./testProject/adapter/
# path: custom chat template (Jinja template), optional
locCustomPromptTemplate=./testProject/llama3_prompt_min.txt
# training epochs (how many times each dataset entry is trained)
# vInplace true: Validation will run after each batch of training epochs until vExpected has been reached, otherwise the next training batch starts
# vInplace false: Training is executed once for trEpochs epochs

View File

@@ -0,0 +1,3 @@
{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>
'+ message['content'] | trim + '<|eot_id|>' %}{{ content }}{% endfor %}