Downloads · 30 days
2
3% of all-time downloads
kosiasuzu/chatml-llama3.1-8b-lora-adapter
chatml-llama3.1-8b-lora-adapter is a text generation model from kosiasuzu. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.1.
LoRA adapter only for the ChatML baseline in the Telos format study. Load on top of kosiasuzu/chatml-agent-llama-3.1-8b-init.
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
74
Public
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 99%
From the Hugging Face model README
LoRA adapter only for the ChatML baseline in the Telos format study. Load on top of kosiasuzu/chatml-agent-llama-3.1-8b-init.
For single-file inference, use: kosiasuzu/chatml-llama3.1-8b-lora-merged.
kosiasuzu/chatml-llama3.1-8b-lora-adapterkosiasuzu/chatml-agent-llama-3.1-8b-init (required)Init base: Llama 3.1 8B base weights + Instruct tokenizer; ChatML special tokens mean-pooled in embedding table (telos init-chatml-embeddings).
Training: messages column on kosiasuzu/telos-agent-trajectory-dataset (ChatML derived from Telos frames); loss on assistant spans via apply_chat_template.
kosiasuzu/chatml-llama3.1-8b-lora-mergedkosiasuzu/telos-llama3.1-8b-lora-adapterkosiasuzu/telos-agent-trajectory-datasetchatml-agent-llama-3.1-8b-init for ChatML agent continuation or further tuning.model.merge_and_unload() → equivalent to merged hub checkpoint.telos eval-format-validity --format chatml --adapter-mode pefttelos-agent-llama-3.1-8b-init or raw meta-llama/Llama-3.1-8B.--format telos eval expects Telos-trained weights).import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id = "kosiasuzu/chatml-agent-llama-3.1-8b-init"
adapter_id = "kosiasuzu/chatml-llama3.1-8b-lora-adapter"
tokenizer = AutoTokenizer.from_pretrained(base_id)
base = AutoModelForCausalLM.from_pretrained(
base_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base, adapter_id)
model.eval()
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello."},
]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
CLI eval (PEFT mode):
telos eval-format-validity \
--format chatml \
--model kosiasuzu/chatml-agent-llama-3.1-8b-init \
--adapter-mode peft \
--adapter-id kosiasuzu/chatml-llama3.1-8b-lora-adapter \
--dataset kosiasuzu/telos-agent-trajectory-dataset \
--split eval \
--output results/chatml_format_validity_peft.json
Produced by telos train-chatml-lora with --adapter-repo-id kosiasuzu/chatml-llama3.1-8b-lora-adapter.
| LoRA setting | Value |
|---|---|
| r | 32 |
| lora_alpha | 64 |
| lora_dropout | 0.05 |
| target_modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, lm_head |
| epochs | 2 |
| learning_rate | 2e-4 |
| max_length | 2048 |
Full training narrative: see chatml-llama3.1-8b-lora-merged.md.
ChatML format validity on eval split. Results: TBD.
Cite Telos repository + Llama 3.1. Adapter: kosiasuzu/chatml-llama3.1-8b-lora-adapter.