aashish1904
commited on
Commit
β’
8e2617c
1
Parent(s):
db2c0a7
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
license: apache-2.0
|
5 |
+
|
6 |
+
---
|
7 |
+
|
8 |
+
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
|
9 |
+
|
10 |
+
# QuantFactory/Yi-Coder-9B-GGUF
|
11 |
+
This is quantized version of [01-ai/Yi-Coder-9B](https://huggingface.co/01-ai/Yi-Coder-9B) created using llama.cpp
|
12 |
+
|
13 |
+
# Original Model Card
|
14 |
+
|
15 |
+
<div align="center">
|
16 |
+
|
17 |
+
<picture>
|
18 |
+
<img src="https://raw.githubusercontent.com/01-ai/Yi/main/assets/img/Yi_logo_icon_light.svg" width="120px">
|
19 |
+
</picture>
|
20 |
+
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<p align="center">
|
24 |
+
<a href="https://github.com/01-ai">π GitHub</a> β’
|
25 |
+
<a href="https://discord.gg/hYUwWddeAu">πΎ Discord</a> β’
|
26 |
+
<a href="https://twitter.com/01ai_yi">π€ Twitter</a> β’
|
27 |
+
<a href="https://github.com/01-ai/Yi-1.5/issues/2">π¬ WeChat</a>
|
28 |
+
<br/>
|
29 |
+
<a href="https://arxiv.org/abs/2403.04652">π Paper</a> β’
|
30 |
+
<a href="https://01-ai.github.io/">πͺ Tech Blog</a> β’
|
31 |
+
<a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#faq">π FAQ</a> β’
|
32 |
+
<a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#learning-hub">π Learning Hub</a>
|
33 |
+
</p>
|
34 |
+
|
35 |
+
# Intro
|
36 |
+
|
37 |
+
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.
|
38 |
+
|
39 |
+
Key features:
|
40 |
+
- Excelling in long-context understanding with a maximum context length of 128K tokens.
|
41 |
+
- Supporting 52 major programming languages:
|
42 |
+
```bash
|
43 |
+
'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'
|
44 |
+
```
|
45 |
+
|
46 |
+
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).
|
47 |
+
|
48 |
+
<p align="left">
|
49 |
+
<img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/yi-coder-calculator-demo.gif?raw=true" alt="demo1" width="500"/>
|
50 |
+
</p>
|
51 |
+
|
52 |
+
# Models
|
53 |
+
|
54 |
+
| Name | Type | Length | Download |
|
55 |
+
|--------------------|------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
|
56 |
+
| 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) |
|
57 |
+
| 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) |
|
58 |
+
| 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) |
|
59 |
+
| 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) |
|
60 |
+
| |
|
61 |
+
|
62 |
+
# Benchmarks
|
63 |
+
|
64 |
+
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%.
|
65 |
+
|
66 |
+
<p align="left">
|
67 |
+
<img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/bench1.webp?raw=true" alt="bench1" width="1000"/>
|
68 |
+
</p>
|
69 |
+
|
70 |
+
# Quick Start
|
71 |
+
|
72 |
+
You can use transformers to run inference with Yi-Coder models (both chat and base versions) as follows:
|
73 |
+
```python
|
74 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
75 |
+
|
76 |
+
device = "cuda" # the device to load the model onto
|
77 |
+
model_path = "01-ai/Yi-Coder-9B-Chat"
|
78 |
+
|
79 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
80 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto").eval()
|
81 |
+
|
82 |
+
prompt = "Write a quick sort algorithm."
|
83 |
+
messages = [
|
84 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
85 |
+
{"role": "user", "content": prompt}
|
86 |
+
]
|
87 |
+
text = tokenizer.apply_chat_template(
|
88 |
+
messages,
|
89 |
+
tokenize=False,
|
90 |
+
add_generation_prompt=True
|
91 |
+
)
|
92 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
93 |
+
|
94 |
+
generated_ids = model.generate(
|
95 |
+
model_inputs.input_ids,
|
96 |
+
max_new_tokens=1024,
|
97 |
+
eos_token_id=tokenizer.eos_token_id
|
98 |
+
)
|
99 |
+
generated_ids = [
|
100 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
101 |
+
]
|
102 |
+
|
103 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
104 |
+
print(response)
|
105 |
+
```
|
106 |
+
|
107 |
+
For getting up and running with Yi-Coder series models quickly, see [Yi-Coder README](https://github.com/01-ai/Yi-Coder).
|
108 |
+
|
109 |
+
|