axolotl-practice
Collection
3 items
β’
Updated
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B",
quantization_config=BitsAndBytesConfig(
load_in_4bit=True,
),
)
model = PeftModel.from_pretrained(base_model, "OsakanaTeishoku/Qwen2.5-7B-axolotl-sft-v0.1")
tokenizer = AutoTokenizer.from_pretrained("OsakanaTeishoku/Qwen2.5-7B-axolotl-sft-v0.1")
from transformers import TextStreamer
streamer = TextStreamer(
tokenizer,
skip_prompt=False,
skip_special_tokens=False,
)
prompt = "γγͺγγ―δ½θ
γ§γγ"
messages = [
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512,
streamer=streamer,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.eos_token_id,
)
axolotl version: 0.8.0
base_model: Qwen/Qwen2.5-7B
hub_model_id: OsakanaTeishoku/custom_model_name
load_in_8bit: false
load_in_4bit: true
strict: false
chat_template: qwen_25
datasets:
# This will be the path used for the data when it is saved to the Volume in the cloud.
- path: Aratako/Magpie-Tanuki-8B-annotated-96k
split: train[0:4000]
type: chat_template
field_messages: messages
dataset_prepared_path: last_run_prepared
val_set_size: 0.05
output_dir: ./lora-out
sequence_len: 2048
sample_packing: false
eval_sample_packing: false
pad_to_sequence_len: false
adapter: qlora
lora_model_dir:
lora_r: 16
lora_alpha: 32
lora_dropout: 0.05
lora_target_linear: true
lora_fan_in_fan_out:
lora_modules_to_save: # required when adding new tokens to LLaMA/Mistral
- embed_tokens
- lm_head
gradient_accumulation_steps: 1
micro_batch_size: 16
num_epochs: 1
optimizer: adamw_torch
lr_scheduler: cosine
learning_rate: 0.0001
bf16: auto
fp16: false
tf32: false
train_on_inputs: false
group_by_length: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
warmup_steps: 10
save_steps:
debug:
deepspeed: /workspace/axolotl/deepspeed_configs/zero2.json
weight_decay: 0.0
fsdp:
fsdp_config:
special_tokens:
eos_token: "<|im_end|>"
plugins:
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_glu_activation: true
liger_layer_norm: true
liger_fused_linear_cross_entropy: true
eval_strategy: "no"
save_strategy: "epoch"
This model is a fine-tuned version of Qwen/Qwen2.5-7B on the Aratako/Magpie-Tanuki-8B-annotated-96k dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
Base model
Qwen/Qwen2.5-7B