Quantization made by Richard Erkhov.
We introduce the latest in the Smaug series, the Dracarys family of finetunes targeting coding performance improvements
across a variety of base models.
This variant is a finetune of
Qwen2-72B-Instruct
Compared to Qwen2-72B-Instruct, Dracarys has better LiveCodeBench scores (see evaluation results below).
The prompt format is unchanged from Qwen2-72B-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]
28
29outputs = pipeline(
30 prompt,
31 max_new_tokens=256,
32 eos_token_id=terminators,
33 do_sample=True,
34 temperature=0.6,
35 top_p=0.9,
36)
37print(outputs[0]["generated_text"][len(prompt):])