CoolFace
Modelpublic

ILoveBuns/adaption_python_mental_execution_trac

sourceHugging Faceotherupdated 1mo agoView on Hugging Face
0likes4downloads
README.md100 linesDownload Raw Back to root
1---2base_model: meta-llama/Llama-3.3-70B-Instruct-Reference3library_name: peft4license: other5tags:6  - lora7  - peft8  - adapter9  - adaption10---11 12# adaption_python_mental_execution_trac13 14## Model Training15 16A LORA adapter for `meta-llama/Llama-3.3-70B-Instruct-Reference`. This model was trained with SFT using [Adaption](https://adaptionlabs.ai)'s AutoScientist on the python_mental_execution_traces dataset.17 18 19![Training metrics](training-metrics.png)20 21### AutoScientist Config22 23```json24{25  "job_id": "01c91058-ec84-419f-be88-8d2990809855",26  "training_experiment_id": "96dd4322-7402-4045-b038-4c5c69d433f5",27  "original_model_name": "meta-llama/Llama-3.3-70B-Instruct-Reference",28  "trained_model_name": "adaption_python_mental_execution_trac",29  "training_method": "sft",30  "training_type": "lora",31  "data_format": "chat",32  "hyperparams": {33    "lora": "true",34    "lora_r": 8,35    "n_evals": 5,36    "n_epochs": 1,37    "batch_size": "max",38    "lora_alpha": 8,39    "lora_dropout": 0,40    "min_lr_ratio": 0.1,41    "warmup_ratio": 0.1,42    "weight_decay": 0,43    "learning_rate": 0.0001,44    "max_grad_norm": 2,45    "base_model_size": "70B",46    "train_on_inputs": "false",47    "training_method": "sft",48    "lr_scheduler_type": "cosine",49    "scheduler_num_cycles": 0.5,50    "lora_trainable_modules": "q_proj,v_proj"51  }52}53```54 55## Training Data56 57The model was trained on 11,631 rows of adapted data with the following domain distribution: code (100%).58 59## Model Evaluation60 61The model was evaluated on an in-distribution held-out test set as well as a broader domain-specific test set to measure generalization.62 63 64![Win rates](win-rates.png)65 66 67## How to use68 69```bash70pip install torch transformers peft71```72 73```python74import torch75from transformers import AutoModelForCausalLM, AutoTokenizer76from peft import PeftModel77 78BASE = "meta-llama/Llama-3.3-70B-Instruct-Reference"79ADAPTER = "<this-repo-id>"80 81device = "cuda" if torch.cuda.is_available() else "cpu"82dtype = torch.float32 if device == "cpu" else torch.bfloat1683 84base = AutoModelForCausalLM.from_pretrained(BASE, dtype=dtype).to(device)85model = PeftModel.from_pretrained(base, ADAPTER)86# Optional: merge the LoRA weights into the base for faster inference87model = model.merge_and_unload()88model.eval()89 90tokenizer = AutoTokenizer.from_pretrained(BASE)91messages = [{"role": "user", "content": "Hello!"}]92text = tokenizer.apply_chat_template(93    messages, tokenize=False, add_generation_prompt=True)94inputs = tokenizer(text, return_tensors="pt").to(device)95 96with torch.inference_mode():97    out = model.generate(**inputs, max_new_tokens=512)98print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))99```100