Downloads · 30 days
6
86% of all-time downloads
Apel-sin/nxcode-CQ-7B-orpo-exl2
nxcode-CQ-7B-orpo-exl2 is a text generation model from Apel-sin. Use it when you need the model to write or continue text. The card lists the license as mit.
Using <a href="https://github.com/turboderp/exllamav2/releases/tag/v0.0.21"turboderp's ExLlamaV2 v0.0.21</a for quantization.
Downloads · 30 days
6
86% of all-time downloads
All-time downloads
7
Public
Repo size
19.6 GB
Likes
0
Public
Click a slice to open those files.
.json1.8 MB · 100%
From the Hugging Face model README
Using <a href="https://github.com/turboderp/exllamav2/releases/tag/v0.0.21">turboderp's ExLlamaV2 v0.0.21</a> for quantization.
<b>The "main" branch only contains the measurement.json, download one of the other branches for the model</b>
Each branch contains an individual bits per weight, with the main one containing only the meaurement.json for further conversions.
Original model: <a href="https://huggingface.co/NTQAI/Nxcode-CQ-7B-orpo">NTQAI/Nxcode-CQ-7B-orpo</a><br> Calibration dataset is based on: <a href="https://huggingface.co/datasets/m-a-p/CodeFeedback-Filtered-Instruction">m-a-p/CodeFeedback-Filtered-Instruction</a>
| Branch | Bits | lm_head bits | Description |
|---|---|---|---|
| 8_0 | 8.0 | 8.0 | Maximum quality that ExLlamaV2 can produce, near unquantized performance. |
| 6_5 | 6.5 | 8.0 | Very similar to 8.0, good tradeoff of size vs performance, recommended. |
| 5_5 | 5.5 | 8.0 | Slightly lower quality vs 6.5, but usable on 8GB cards. |
<a href="https://ntq.com.vn" target="_blank"><img src="https://cdn-uploads.huggingface.co/production/uploads/5ee1b417636bdb3834e2da19/etbfTJuVdAub2evNP_E4g.png" width="200"/></a>
Nxcode-CQ-7B-orpo is an Monolithic Preference Optimization without Reference Model fine-tune of Qwen/CodeQwen1.5-7B on 100k samples of high-quality ranking data.
| EvalPlus | pass@1 |
|---|---|
| HumanEval | 86.6 |
| HumanEval+ | 83.5 |
| MBPP(v0.2.0) | 82.3 |
| MBPP+(v0.2.0) | 70.4 |
We use a simple template to generate the solution for evalplus:
"Complete the following Python function:\n{prompt}"
| Models | HumanEval | HumanEval+ |
|---|---|---|
| GPT-4-Turbo (April 2024) | 90.2 | 86.6 |
| GPT-4 (May 2023) | 88.4 | 81.17 |
| GPT-4-Turbo (Nov 2023) | 85.4 | 79.3 |
| CodeQwen1.5-7B-Chat | 83.5 | 78.7 |
| claude-3-opus (Mar 2024) | 82.9 | 76.8 |
| DeepSeek-Coder-33B-instruct | 81.1 | 75.0 |
| WizardCoder-33B-V1.1 | 79.9 | 73.2 |
| OpenCodeInterpreter-DS-33B | 79.3 | 73.8 |
| speechless-codellama-34B-v2.0 | 77.4 | 72 |
| GPT-3.5-Turbo (Nov 2023) | 76.8 | 70.7 |
| Llama3-70B-instruct | 76.2 | 70.7 |
09/05/2024
Top 1 average score.
Top 2 winrate.

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents. You should upgrade the transformers if you receive an error when loading the tokenizer
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained(
"NTQAI/Nxcode-CQ-7B-orpo",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("NTQAI/Nxcode-CQ-7B-orpo")
prompt = """Complete the following Python function:
from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
""" Check if in given list of numbers, are any two numbers closer to each other than
given threshold.
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
False
>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)
True
"""
"""
messages = [
{"role": "user", "content": prompt}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
res = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
For personal communication related to this project, please contact Nha Nguyen Van ([email protected]).