LoneStriker
commited on
Commit
•
bd7e2be
1
Parent(s):
59946b4
Upload folder using huggingface_hub
Browse files- .gitattributes +5 -35
- Nxcode-CQ-7B-orpo-Q3_K_L.gguf +3 -0
- Nxcode-CQ-7B-orpo-Q4_K_M.gguf +3 -0
- Nxcode-CQ-7B-orpo-Q5_K_M.gguf +3 -0
- Nxcode-CQ-7B-orpo-Q6_K.gguf +3 -0
- Nxcode-CQ-7B-orpo-Q8_0.gguf +3 -0
- README.md +95 -0
.gitattributes
CHANGED
@@ -1,35 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
Nxcode-CQ-7B-orpo-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
2 |
+
Nxcode-CQ-7B-orpo-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
3 |
+
Nxcode-CQ-7B-orpo-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
4 |
+
Nxcode-CQ-7B-orpo-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
5 |
+
Nxcode-CQ-7B-orpo-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Nxcode-CQ-7B-orpo-Q3_K_L.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe58ab59ab170babc341a5e68e0a0c6ae3539cb63161c8db089c10df020eb1e4
|
3 |
+
size 3986819168
|
Nxcode-CQ-7B-orpo-Q4_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d58ec20e67dd7b57c89718a199878f2b990e54c4ae5ec99f33ce290d82256f57
|
3 |
+
size 4738590816
|
Nxcode-CQ-7B-orpo-Q5_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:631827df7962423638878a4a84f01201de6b546c036cdded5dc697141b3c4f13
|
3 |
+
size 5428160608
|
Nxcode-CQ-7B-orpo-Q6_K.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ded4ee8f1297012f1084d4b12a5118333b4535f7be004512927d190687cdf3e0
|
3 |
+
size 6377588832
|
Nxcode-CQ-7B-orpo-Q8_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c7bcb190bf99470b17c53460eae35fa3d3cd2e0a6eee08c932ddf29e744b0335
|
3 |
+
size 7706773600
|
README.md
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
tags:
|
4 |
+
- code
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
|
8 |
+
<a href="https://ntq.com.vn" target="_blank"><img src="https://cdn-uploads.huggingface.co/production/uploads/5ee1b417636bdb3834e2da19/etbfTJuVdAub2evNP_E4g.png" width="200"/></a>
|
9 |
+
|
10 |
+
## Introduction
|
11 |
+
|
12 |
+
Nxcode-CQ-7B-orpo is an [Monolithic Preference Optimization without Reference Model](https://arxiv.org/abs/2403.07691) fine-tune of Qwen/CodeQwen1.5-7B on 100k samples of high-quality ranking data.
|
13 |
+
|
14 |
+
## [Evalplus](https://github.com/evalplus/evalplus)
|
15 |
+
|
16 |
+
| EvalPlus | pass@1 |
|
17 |
+
| --- | --- |
|
18 |
+
| HumanEval | 86.6 |
|
19 |
+
| HumanEval+ | 83.5 |
|
20 |
+
| MBPP(v0.2.0) | 82.3 |
|
21 |
+
| MBPP+(v0.2.0) | 70.4 |
|
22 |
+
|
23 |
+
We use a simple template to generate the solution for evalplus:
|
24 |
+
|
25 |
+
```python
|
26 |
+
"Complete the following Python function:\n{prompt}"
|
27 |
+
```
|
28 |
+
|
29 |
+
[Evalplus Leaderboard](https://evalplus.github.io/leaderboard.html)
|
30 |
+
| Models | HumanEval | HumanEval+|
|
31 |
+
|------ | ------ | ------ |
|
32 |
+
| GPT-4-Turbo (April 2024)| 90.2| 86.6|
|
33 |
+
| GPT-4 (May 2023)| 88.4| 81.17|
|
34 |
+
| GPT-4-Turbo (Nov 2023)| 85.4| 79.3|
|
35 |
+
| CodeQwen1.5-7B-Chat| 83.5| 78.7|
|
36 |
+
| claude-3-opus (Mar 2024)| 82.9| 76.8|
|
37 |
+
| DeepSeek-Coder-33B-instruct| 81.1| 75.0|
|
38 |
+
| WizardCoder-33B-V1.1| 79.9| 73.2|
|
39 |
+
| OpenCodeInterpreter-DS-33B| 79.3| 73.8|
|
40 |
+
| speechless-codellama-34B-v2.0| 77.4| 72|
|
41 |
+
| GPT-3.5-Turbo (Nov 2023)| 76.8| 70.7|
|
42 |
+
| Llama3-70B-instruct| 76.2| 70.7|
|
43 |
+
|
44 |
+
## Bigcode Leaderboard
|
45 |
+
|
46 |
+
[Bigcode Leaderboard](https://huggingface.co/spaces/bigcode/bigcode-models-leaderboard)
|
47 |
+
|
48 |
+
**09/05/2024**
|
49 |
+
|
50 |
+
Top 1 average score.
|
51 |
+
|
52 |
+
Top 2 winrate.
|
53 |
+
|
54 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/5ee1b417636bdb3834e2da19/OQonD6a7aNjnN9SsTkFp-.png)
|
55 |
+
|
56 |
+
|
57 |
+
## Quickstart
|
58 |
+
|
59 |
+
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
|
60 |
+
```python
|
61 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
62 |
+
device = "cuda" # the device to load the model onto
|
63 |
+
|
64 |
+
model = AutoModelForCausalLM.from_pretrained(
|
65 |
+
"NTQAI/Nxcode-CQ-7B-orpo",
|
66 |
+
torch_dtype="auto",
|
67 |
+
device_map="auto"
|
68 |
+
)
|
69 |
+
tokenizer = AutoTokenizer.from_pretrained("NTQAI/Nxcode-CQ-7B-orpo")
|
70 |
+
|
71 |
+
prompt = """Complete the following Python function:
|
72 |
+
from typing import List
|
73 |
+
|
74 |
+
|
75 |
+
def has_close_elements(numbers: List[float], threshold: float) -> bool:
|
76 |
+
""" Check if in given list of numbers, are any two numbers closer to each other than
|
77 |
+
given threshold.
|
78 |
+
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
|
79 |
+
False
|
80 |
+
>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)
|
81 |
+
True
|
82 |
+
"""
|
83 |
+
"""
|
84 |
+
messages = [
|
85 |
+
{"role": "user", "content": prompt}
|
86 |
+
]
|
87 |
+
|
88 |
+
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
89 |
+
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)
|
90 |
+
res = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
|
91 |
+
|
92 |
+
```
|
93 |
+
|
94 |
+
### Contact information
|
95 |
+
For personal communication related to this project, please contact Nha Nguyen Van (nha.nguyen@ntq-solution.com.vn).
|