We introduce the latest in the Smaug series, the Dracarys family of finetunes targeting coding performance improvements
across a variety of base models.
Compared to meta-llama/Meta-Llama-3.1-70B-Instruct, Dracarys has better LiveCodeBench scores (see evaluation results below).
The prompt format is unchanged from Llama 3 70B Instruct (see evaluations for prompt details for LCB)
1import transformers
2import torch
3
4model_id = "abacusai/Dracarys-72B-Instruct"
5
6pipeline = transformers.pipeline(
7 "text-generation",
8 model=model_id,
9 model_kwargs={"torch_dtype": torch.bfloat16},
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "You are data science coding assistant that generates Python code using Pandas and Numpy."},
15 {"role": "user", "content": "Write code to select rows from the dataframe `df` having the maximum `temp` for each `city`"},
16]
17
18prompt = pipeline.tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True
22)
23
24terminators = [
25 pipeline.tokenizer.eos_token_id,
26 pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>"),
27 pipeline.tokenizer.convert_tokens_to_ids("<|end_of_text|>"),
28]
29
30outputs = pipeline(
31 prompt,
32 max_new_tokens=256,
33 eos_token_id=terminators,
34 do_sample=True,
35 temperature=0.6,
36 top_p=0.9,
37)
38print(outputs[0]["generated_text"][len(prompt):])