BenevolenceMessiah commited on
Commit
bf8266f
Β·
verified Β·
1 Parent(s): 4349fc1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +101 -10
README.md CHANGED
@@ -1,13 +1,13 @@
1
- ---
2
- base_model:
3
- - 01-ai/Yi-Coder-9B-Chat
4
- - 01-ai/Yi-Coder-9B
5
- library_name: transformers
6
- tags:
7
- - mergekit
8
- - merge
9
-
10
- ---
11
  # merge
12
 
13
  This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
@@ -44,3 +44,94 @@ parameters:
44
  int8_mask: true
45
  dtype: float16
46
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - 01-ai/Yi-Coder-9B-Chat
4
+ - 01-ai/Yi-Coder-9B
5
+ library_name: transformers
6
+ tags:
7
+ - mergekit
8
+ - merge
9
+ license: apache-2.0
10
+ ---
11
  # merge
12
 
13
  This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
 
44
  int8_mask: true
45
  dtype: float16
46
  ```
47
+ <picture>
48
+ <img src="https://raw.githubusercontent.com/01-ai/Yi/main/assets/img/Yi_logo_icon_light.svg" width="120px">
49
+ </picture>
50
+
51
+ </div>
52
+
53
+ <p align="center">
54
+ <a href="https://github.com/01-ai">πŸ™ GitHub</a> β€’
55
+ <a href="https://discord.gg/hYUwWddeAu">πŸ‘Ύ Discord</a> β€’
56
+ <a href="https://twitter.com/01ai_yi">🐀 Twitter</a> β€’
57
+ <a href="https://github.com/01-ai/Yi-1.5/issues/2">πŸ’¬ WeChat</a>
58
+ <br/>
59
+ <a href="https://arxiv.org/abs/2403.04652">πŸ“ Paper</a> β€’
60
+ <a href="https://01-ai.github.io/">πŸ’ͺ Tech Blog</a> β€’
61
+ <a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#faq">πŸ™Œ FAQ</a> β€’
62
+ <a href="https://github.com/01-ai/Yi/tree/main?tab=readme-ov-file#learning-hub">πŸ“— Learning Hub</a>
63
+ </p>
64
+
65
+ # Intro
66
+
67
+ 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.
68
+
69
+ Key features:
70
+ - Excelling in long-context understanding with a maximum context length of 128K tokens.
71
+ - Supporting 52 major programming languages:
72
+ ```bash
73
+ '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'
74
+ ```
75
+
76
+ 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).
77
+
78
+ <p align="left">
79
+ <img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/yi-coder-calculator-demo.gif?raw=true" alt="demo1" width="500"/>
80
+ </p>
81
+
82
+ # Models
83
+
84
+ | Name | Type | Length | Download |
85
+ |--------------------|------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
86
+ | 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) |
87
+ | 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) |
88
+ | 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) |
89
+ | 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) |
90
+ | |
91
+
92
+ # Benchmarks
93
+
94
+ 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%.
95
+
96
+ <p align="left">
97
+ <img src="https://github.com/01-ai/Yi/blob/main/assets/img/coder/bench1.webp?raw=true" alt="bench1" width="1000"/>
98
+ </p>
99
+
100
+ # Quick Start
101
+
102
+ You can use transformers to run inference with Yi-Coder models (both chat and base versions) as follows:
103
+ ```python
104
+ from transformers import AutoTokenizer, AutoModelForCausalLM
105
+
106
+ device = "cuda" # the device to load the model onto
107
+ model_path = "01-ai/Yi-Coder-9B-Chat"
108
+
109
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
110
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto").eval()
111
+
112
+ prompt = "Write a quick sort algorithm."
113
+ messages = [
114
+ {"role": "system", "content": "You are a helpful assistant."},
115
+ {"role": "user", "content": prompt}
116
+ ]
117
+ text = tokenizer.apply_chat_template(
118
+ messages,
119
+ tokenize=False,
120
+ add_generation_prompt=True
121
+ )
122
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
123
+
124
+ generated_ids = model.generate(
125
+ model_inputs.input_ids,
126
+ max_new_tokens=1024,
127
+ eos_token_id=tokenizer.eos_token_id
128
+ )
129
+ generated_ids = [
130
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
131
+ ]
132
+
133
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
134
+ print(response)
135
+ ```
136
+
137
+ For getting up and running with Yi-Coder series models quickly, see [Yi-Coder README](https://github.com/01-ai/Yi-Coder).