Downloads · 30 days
108
8% of all-time downloads
sahil2801/instruct-codegen-16B
instruct-codegen-16B is a text generation model from sahil2801. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as bsd-3-clause.
Instruct-codegen-16B is an instruction following codegen model based on Salesforce codegen-16B-multi , finetuned on a dataset of 250k instruction-following samples in the alpaca format.
Downloads · 30 days
108
8% of all-time downloads
All-time downloads
1.3K
Public
Repo size
64.4 GB
Likes
21
Public
Click a slice to open those files.
.bin32.2 GB · 100%
From the Hugging Face model README
Instruct-codegen-16B is an instruction following codegen model based on Salesforce codegen-16B-multi , finetuned on a dataset of 250k instruction-following samples in the alpaca format.
The data was not generated using any commercial LLM api.
The model achieves a result of 37.1% pass@1 on the HumanEval benchmark.
# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "sahil2801/instruct-codegen-16B"
device = "cuda"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).half().to(device)
instruction = "Write a function to scrape hacker news."
prompt = f"Below is an instruction that describes a task.\n Write a response that appropriately completes the request.\n\n ### Instruction:\n{instruction}\n\n### Response:"
inputs = tokenizer(prompt, return_tensors="pt").to(device)
outputs = model.generate(**inputs,temperature=0.3,do_sample=True,max_new_tokens=256)
print(tokenizer.decode(outputs[0],skip_special_tokens=True))