Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Quantization made by Richard Erkhov.

Github

Discord

Request more models

Yi-Coder-9B - GGUF

Name Quant method Size
Yi-Coder-9B.Q2_K.gguf Q2_K 3.12GB
Yi-Coder-9B.IQ3_XS.gguf IQ3_XS 3.46GB
Yi-Coder-9B.IQ3_S.gguf IQ3_S 3.64GB
Yi-Coder-9B.Q3_K_S.gguf Q3_K_S 3.63GB
Yi-Coder-9B.IQ3_M.gguf IQ3_M 3.78GB
Yi-Coder-9B.Q3_K.gguf Q3_K 4.03GB
Yi-Coder-9B.Q3_K_M.gguf Q3_K_M 4.03GB
Yi-Coder-9B.Q3_K_L.gguf Q3_K_L 4.37GB
Yi-Coder-9B.IQ4_XS.gguf IQ4_XS 4.5GB
Yi-Coder-9B.Q4_0.gguf Q4_0 4.69GB
Yi-Coder-9B.IQ4_NL.gguf IQ4_NL 4.73GB
Yi-Coder-9B.Q4_K_S.gguf Q4_K_S 4.72GB
Yi-Coder-9B.Q4_K.gguf Q4_K 4.96GB
Yi-Coder-9B.Q4_K_M.gguf Q4_K_M 4.96GB
Yi-Coder-9B.Q4_1.gguf Q4_1 5.19GB
Yi-Coder-9B.Q5_0.gguf Q5_0 5.69GB
Yi-Coder-9B.Q5_K_S.gguf Q5_K_S 5.69GB
Yi-Coder-9B.Q5_K.gguf Q5_K 5.83GB
Yi-Coder-9B.Q5_K_M.gguf Q5_K_M 5.83GB
Yi-Coder-9B.Q5_1.gguf Q5_1 6.19GB
Yi-Coder-9B.Q6_K.gguf Q6_K 6.75GB
Yi-Coder-9B.Q8_0.gguf Q8_0 8.74GB

Original model description:

license: apache-2.0 library_name: transformers

πŸ™ GitHub β€’ πŸ‘Ύ Discord β€’ 🐀 Twitter β€’ πŸ’¬ WeChat
πŸ“ Paper β€’ πŸ’ͺ Tech Blog β€’ πŸ™Œ FAQ β€’ πŸ“— Learning Hub

Intro

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.

Key features:

  • Excelling in long-context understanding with a maximum context length of 128K tokens.
  • Supporting 52 major programming languages:
  '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'

For model details and benchmarks, see Yi-Coder blog and Yi-Coder README.

demo1

Models

Name Type Length Download
Yi-Coder-9B-Chat Chat 128K πŸ€— Hugging Face β€’ πŸ€– ModelScope β€’ 🟣 wisemodel
Yi-Coder-1.5B-Chat Chat 128K πŸ€— Hugging Face β€’ πŸ€– ModelScope β€’ 🟣 wisemodel
Yi-Coder-9B Base 128K πŸ€— Hugging Face β€’ πŸ€– ModelScope β€’ 🟣 wisemodel
Yi-Coder-1.5B Base 128K πŸ€— Hugging Face β€’ πŸ€– ModelScope β€’ 🟣 wisemodel

Benchmarks

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%.

bench1

Quick Start

You can use transformers to run inference with Yi-Coder models (both chat and base versions) as follows:

from transformers import AutoTokenizer, AutoModelForCausalLM

device = "cuda" # the device to load the model onto
model_path = "01-ai/Yi-Coder-9B-Chat"

tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto").eval()

prompt = "Write a quick sort algorithm."
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=1024,
    eos_token_id=tokenizer.eos_token_id  
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

For getting up and running with Yi-Coder series models quickly, see Yi-Coder README.

Downloads last month
395
GGUF
Model size
8.83B params
Architecture
llama

2-bit

3-bit

4-bit

5-bit

6-bit

8-bit

Inference API
Unable to determine this model's library. Check the docs .