Transformers
GGUF
conversational
aashish1904 commited on
Commit
eb28627
Β·
verified Β·
1 Parent(s): cb31bc6

Upload README.md with huggingface_hub

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