|
|
--- |
|
|
license: apache-2.0 |
|
|
datasets: |
|
|
- open-r1/codeforces-cots_decontaminated |
|
|
language: |
|
|
- en |
|
|
base_model: |
|
|
- Qwen/Qwen2.5-Coder-7B-Instruct |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
# Model Card for NormolLM-Coder-7B (Change to correct name) |
|
|
|
|
|
NormolLM-Coder-7B is a medium sized coding model, that achieves strong performance on benchmarks such as Live Code Bench and the new International Olympiad in Informatics benchmark. |
|
|
|
|
|
## Model description |
|
|
|
|
|
- **Model type:** A 7B parameter model fine-tuned on a decontaminated version of the codeforces dataset. |
|
|
- **Language(s) (NLP):** Primarily English |
|
|
- **License:** MIT |
|
|
- **Finetuned from model:** [Qwen/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) |
|
|
|
|
|
## Performance |
|
|
| Model | LCB | IOI | |
|
|
|-------|-----|---------------| |
|
|
|NormolLM-Coder-7B| 123 | 456 | |
|
|
|GPT-4o| 28.43|| |
|
|
|Claude 3.7 Sonnet| 39.18|| |
|
|
|QwQ-32B| 60.98|| |
|
|
|DeepSeek-R1-Distill-Qwen-32B| 56.58|| |
|
|
|DeepSeek-R1-Distill-Qwen-7B| 37.36|| |
|
|
|Qwen2.5-Coder-32B| 28.31|| |
|
|
|Qwen2.5-Coder-7B| 15.83|| |
|
|
Here's how you can run the model using the `pipeline()` function from 🤗 Transformers: |
|
|
|
|
|
```python |
|
|
# pip install transformers |
|
|
# pip install accelerate |
|
|
|
|
|
import torch |
|
|
from transformers import pipeline |
|
|
|
|
|
pipe = pipeline("text-generation", model="open-r1/NormolLM-coder-7b-v02.12", torch_dtype=torch.bfloat16, device_map="auto") |
|
|
|
|
|
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating |
|
|
messages = [ |
|
|
{ |
|
|
"role": "system", |
|
|
"content": "You are a friendly chatbot who always responds in the style of a pirate", |
|
|
}, |
|
|
{"role": "user", "content": "Write a python program to calulate the 10th fibonaci number"}, |
|
|
] |
|
|
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) |
|
|
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95) |
|
|
print(outputs[0]["generated_text"]) |
|
|
# <|system|> |
|
|
# You are a friendly chatbot who always responds in the style of a pirate.</s> |
|
|
# <|user|> |
|
|
# How many helicopters can a human eat in one sitting?</s> |
|
|
# <|assistant|> |
|
|
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food! |
|
|
``` |