Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +99 -0
- yi-coder-9b-chat.Q4_0.gguf +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
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
|
36 |
+
yi-coder-9b-chat.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
license: apache-2.0
|
4 |
+
base_model: 01-ai/Yi-Coder-9B
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
<div align="center">
|
8 |
+
|
9 |
+
<picture>
|
10 |
+
<img src="https://raw.githubusercontent.com/01-ai/Yi/main/assets/img/Yi_logo_icon_light.svg" width="120px">
|
11 |
+
</picture>
|
12 |
+
|
13 |
+
</div>
|
14 |
+
|
15 |
+
<p align="center">
|
16 |
+
<a href="https://github.com/01-ai">π GitHub</a> β’
|
17 |
+
<a href="https://discord.gg/hYUwWddeAu">πΎ Discord</a> β’
|
18 |
+
<a href="https://twitter.com/01ai_yi">π€ Twitter</a> β’
|
19 |
+
<a href="https://github.com/01-ai/Yi-1.5/issues/2">π¬ WeChat</a>
|
20 |
+
<br/>
|
21 |
+
<a href="https://arxiv.org/abs/2403.04652">π Paper</a> β’
|
22 |
+
<a href="https://01-ai.github.io/">πͺ Tech Blog</a> β’
|
23 |
+
<a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#faq">π FAQ</a> β’
|
24 |
+
<a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#learning-hub">π Learning Hub</a>
|
25 |
+
</p>
|
26 |
+
|
27 |
+
# Intro
|
28 |
+
|
29 |
+
Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters.
|
30 |
+
|
31 |
+
Key features:
|
32 |
+
- Excelling in long-context understanding with a maximum context length of 128K tokens.
|
33 |
+
- Supporting 52 major programming languages:
|
34 |
+
```bash
|
35 |
+
'java', 'markdown', 'python', 'php', 'javascript', 'c++', 'c#', 'c', 'typescript', 'html', 'go', 'java_server_pages', 'dart', 'objective-c', 'kotlin', 'tex', 'swift', 'ruby', 'sql', 'rust', 'css', 'yaml', 'matlab', 'lua', 'json', 'shell', 'visual_basic', 'scala', 'rmarkdown', 'pascal', 'fortran', 'haskell', 'assembly', 'perl', 'julia', 'cmake', 'groovy', 'ocaml', 'powershell', 'elixir', 'clojure', 'makefile', 'coffeescript', 'erlang', 'lisp', 'toml', 'batchfile', 'cobol', 'dockerfile', 'r', 'prolog', 'verilog'
|
36 |
+
```
|
37 |
+
|
38 |
+
For model details and benchmarks, see [Yi-Coder blog](https://01-ai.github.io/) and [Yi-Coder README](https://github.com/01-ai/Yi-Coder).
|
39 |
+
|
40 |
+
<p align="left">
|
41 |
+
<img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/yi-coder-calculator-demo.gif?raw=true" alt="demo1" width="500"/>
|
42 |
+
</p>
|
43 |
+
|
44 |
+
# Models
|
45 |
+
|
46 |
+
| Name | Type | Length | Download |
|
47 |
+
|--------------------|------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
|
48 |
+
| Yi-Coder-9B-Chat | Chat | 128K | [π€ Hugging Face](https://huggingface.co/01-ai/Yi-Coder-9B-Chat) β’ [π€ ModelScope](https://www.modelscope.cn/models/01ai/Yi-Coder-9B-Chat) β’ [π£ wisemodel](https://wisemodel.cn/models/01.AI/Yi-Coder-9B-Chat) |
|
49 |
+
| Yi-Coder-1.5B-Chat | Chat | 128K | [π€ Hugging Face](https://huggingface.co/01-ai/Yi-Coder-1.5B-Chat) β’ [π€ ModelScope](https://www.modelscope.cn/models/01ai/Yi-Coder-1.5B-Chat) β’ [π£ wisemodel](https://wisemodel.cn/models/01.AI/Yi-Coder-1.5B-Chat) |
|
50 |
+
| Yi-Coder-9B | Base | 128K | [π€ Hugging Face](https://huggingface.co/01-ai/Yi-Coder-9B) β’ [π€ ModelScope](https://www.modelscope.cn/models/01ai/Yi-Coder-9B) β’ [π£ wisemodel](https://wisemodel.cn/models/01.AI/Yi-Coder-9B) |
|
51 |
+
| Yi-Coder-1.5B | Base | 128K | [π€ Hugging Face](https://huggingface.co/01-ai/Yi-Coder-1.5B) β’ [π€ ModelScope](https://www.modelscope.cn/models/01ai/Yi-Coder-1.5B) β’ [π£ wisemodel](https://wisemodel.cn/models/01.AI/Yi-Coder-1.5B) |
|
52 |
+
| |
|
53 |
+
|
54 |
+
# Benchmarks
|
55 |
+
|
56 |
+
As illustrated in the figure below, Yi-Coder-9B-Chat achieved an impressive 23% pass rate in LiveCodeBench, making it the only model with under 10B parameters to surpass 20%. It also outperforms DeepSeekCoder-33B-Ins at 22.3%, CodeGeex4-9B-all at 17.8%, CodeLLama-34B-Ins at 13.3%, and CodeQwen1.5-7B-Chat at 12%.
|
57 |
+
|
58 |
+
<p align="left">
|
59 |
+
<img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/bench1.webp?raw=true" alt="bench1" width="1000"/>
|
60 |
+
</p>
|
61 |
+
|
62 |
+
# Quick Start
|
63 |
+
|
64 |
+
You can use transformers to run inference with Yi-Coder models (both chat and base versions) as follows:
|
65 |
+
```python
|
66 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
67 |
+
|
68 |
+
device = "cuda" # the device to load the model onto
|
69 |
+
model_path = "01-ai/Yi-Coder-9B-Chat"
|
70 |
+
|
71 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
72 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto").eval()
|
73 |
+
|
74 |
+
prompt = "Write a quick sort algorithm."
|
75 |
+
messages = [
|
76 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
77 |
+
{"role": "user", "content": prompt}
|
78 |
+
]
|
79 |
+
text = tokenizer.apply_chat_template(
|
80 |
+
messages,
|
81 |
+
tokenize=False,
|
82 |
+
add_generation_prompt=True
|
83 |
+
)
|
84 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
85 |
+
|
86 |
+
generated_ids = model.generate(
|
87 |
+
model_inputs.input_ids,
|
88 |
+
max_new_tokens=1024,
|
89 |
+
eos_token_id=tokenizer.eos_token_id
|
90 |
+
)
|
91 |
+
generated_ids = [
|
92 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
93 |
+
]
|
94 |
+
|
95 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
96 |
+
print(response)
|
97 |
+
```
|
98 |
+
|
99 |
+
For getting up and running with Yi-Coder series models quickly, see [Yi-Coder README](https://github.com/01-ai/Yi-Coder).
|
yi-coder-9b-chat.Q4_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9987f9e3dd167d2b79431e8963301e9f45fa4b768a590547a7289abb76270372
|
3 |
+
size 5036995424
|