Views
No views yet
Astraios-3B-P-Tuning is an instruction tuned model with 15.5B parameters created by finetuning StarCoderBase on CommitPackFT & OASST as described in the Astraios paper.
| Data | CommitPackFT+OASST | Filtered version of CommitPack and OASST for high-quality commit messages that resemble instructions |
|---|---|---|
| Model | Astraios-1B | Collection of StarCoderBase-1B models instruction tuned on CommitPackFT + OASST with different tuning methods |
| Astraios-3B | Collection of StarCoderBase-3B (3B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods | |
| Astraios-7B | Collection of StarCoderBase-7B (7B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods | |
| Astraios-16B | Collection of StarCoderBase-16B (16B parameters) models instruction tuned on CommitPackFT + OASST with different tuning methods | |
| Evaluation | BigCloneBench | Dataset for clone detection; We use 2,000 samples for evaluation |
| Devign | Dataset for defect detection; We use 2,000 samples for evaluation | |
| HumanEvalPack | Extension of OpenAI's HumanEval to cover 3 scenarios across 6 languages | |
| ReCode | Dataset for the robustness of code generation, covering 4 variants | |
| Asleep At The Keyboard | Datasets for security of code generation; We use DoW for evaluation |
1# pip install -q transformers
2# pip install -e git+https://github.com/bigcode-project/astraios#subdirectory=peft
3from peft import PeftModel
4from transformers import AutoModelForCausalLM, AutoTokenizer
5
6peft_checkpoint = "bigcode/astraios-3b-ptuning"
7checkpoint = "bigcode/starcoderbase-3b"
8model = AutoModelForCausalLM.from_pretrained(checkpoint)
9model = PeftModel.from_pretrained(model, peft_checkpoint)
10device = "cuda" # for GPU usage or "cpu" for CPU usage
11
12tokenizer = AutoTokenizer.from_pretrained(checkpoint)
13model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
14
15inputs = tokenizer.encode("Question: Please write a function in Python that performs bubble sort.
16
17Answer:", return_tensors="pt").to(device)
18outputs = model.generate(inputs)
19print(tokenizer.decode(outputs[0]))