Run this model with HF Jobs
Run bigcode/astraios-ptuning on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/bigcode/astraios-ptuning. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/bigcode/astraios-ptuning on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use bigcode/astraios-ptuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use bigcode/astraios-ptuning with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("bigcode/starcoderbase") model = PeftModel.from_pretrained(base_model, "bigcode/astraios-ptuning") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files123456789---library_name: peft---## Training procedure### Framework versions- PEFT 0.6.0.dev0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143---license: bigcode-openrail-mdatasets:- bigcode/guanaco-commitsmetrics:- code_evallibrary_name: pefttags:- code---# Astraios: A Recipe for Parameter-Efficient Instruction Tuning Code Language Models<p align="center" width="100%"><a ><img src="https://github.com/bigcode-project/astraios/blob/main/visuals/banner.png?raw=true" alt="Astraios" style="width: 20%; min-width: 300px; display: block; margin: auto;"></a></p># Table of Contents1. [Model Summary](#model-summary)2. [Use](#use)3. [Training](#training)4. [Citation](#citation)# Model Summary> Astraios-P-Tuning is an instruction tuned model with 15.5B parameters created by finetuning StarCoderBase on CommitPackFT & OASST as described in the Astraios paper.- **Repository:** [bigcode-project/astraios](https://github.com/bigcode-project/astraios)- **Paper:** [Astraios: A Recipe for Parameter Efficient Instruction Tuning Code Language Models]()- **Languages:** 80+ Programming languages- **✨Astraios:**<table><tr><th>Data</t><td><a href=https://huggingface.co/datasets/bigcode/guanaco-commits>CommitPackFT+OASST</a></td><td>Filtered version of CommitPack and OASST for high-quality commit messages that resemble instructions</td></tr><tr><th>Model</t><td><a href=https://huggingface.co/collections/bigcode/astraios-1b-6576ff1b8e449026ae327c1c>Astraios-1B</a></td><td>Collection of StarCoderBase-1B models instruction tuned on CommitPackFT + OASST with different tuning methods</td></tr><tr><th></t><td><a href=https://huggingface.co/collections/bigcode/astraios-3b-6577127317ee44ff547252d3>Astraios-3B</a></td><td>Collection of StarCoderBase-3B (3B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods</td></tr><tr><th></t><td><a href=https://huggingface.co/collections/starpeft/starcoderbase-7b-650c1f028b45cfec8e72c265>Astraios-7B</a></td><td>Collection of StarCoderBase-7B (7B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods</td></tr><tr><th></t><td><a href=https://huggingface.co/collections/bigcode/astraios-16b-65788b7476b6de79781054cc>Astraios-16B</a></td><td>Collection of StarCoderBase-16B (16B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods</td></tr><tr><th>Evaluation</t><td><a href=https://huggingface.co/datasets/code_x_glue_cc_clone_detection_big_clone_bench>BigCloneBench</a></td><td>Dataset for clone detection; We use 2,000 samples for evaluation</td></tr><tr><th></t><td><a href=https://huggingface.co/datasets/code_x_glue_cc_defect_detection>Devign</a></td><td>Dataset for defect detection; We use 2,000 samples for evaluation</td></tr><tr><th></t><td><a href=https://huggingface.co/datasets/bigcode/humanevalpack>HumanEvalPack</a></td><td>Extension of OpenAI's HumanEval to cover 3 scenarios across 6 languages</td></tr><tr><th></t><td><a href=https://huggingface.co/datasets/RaymondLi/perturbed_humaneval>ReCode</a></td><td>Dataset for the robustness of code generation, covering 4 variants</td></tr><tr><th></t><td><a href=https://huggingface.co/datasets/moyix/asleep_keyboard>Asleep At The Keyboard</a></td><td>Datasets for security of code generation; We use DoW for evaluation</td></tr></table># Use## Intended useThe model follows instructions provided in the input. You should always preface your input with "Question: " and finish it with "Answer:", for example: "Question: Please write a function in Python that performs bubble sort.Answer:"**Feel free to share your generations in the Community tab!**## Generation```python# pip install -q transformers# pip install -e git+https://github.com/bigcode-project/astraios#subdirectory=peftfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizerpeft_checkpoint = "bigcode/astraios-ptuning"checkpoint = "bigcode/starcoderbase"model = AutoModelForCausalLM.from_pretrained(checkpoint)model = PeftModel.from_pretrained(model, peft_checkpoint)device = "cuda" # for GPU usage or "cpu" for CPU usagetokenizer = AutoTokenizer.from_pretrained(checkpoint)model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)inputs = tokenizer.encode("Question: Please write a function in Python that performs bubble sort.Answer:", return_tensors="pt").to(device)outputs = model.generate(inputs)print(tokenizer.decode(outputs[0]))```# Training## Model- **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective- **Steps:** 250k pretraining & 200 instruction tuning- **Precision:** fp32## Hardware- **Pretraining:**- **GPUs:** 512 Tesla A100- **Training time:** 24 days- **Instruction tuning:**- **GPUs:** 8 Tesla A100## Software- **Orchestration:** [Megatron-LM/Transformers](https://github.com/bigcode-project/octopack#training)- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)# Citation```bibtex```
README.md+137-3