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%.
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 inzip(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
.
Runs of 01-ai Yi-Coder-9B on huggingface.co
10.9K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About Yi-Coder-9B huggingface.co Model
Yi-Coder-9B huggingface.co is an AI model on huggingface.co that provides Yi-Coder-9B's model effect (), which can be used instantly with this 01-ai Yi-Coder-9B model. huggingface.co supports a free trial of the Yi-Coder-9B model, and also provides paid use of the Yi-Coder-9B. Support call Yi-Coder-9B model through api, including Node.js, Python, http.
Yi-Coder-9B huggingface.co is an online trial and call api platform, which integrates Yi-Coder-9B's modeling effects, including api services, and provides a free online trial of Yi-Coder-9B, you can try Yi-Coder-9B online for free by clicking the link below.
01-ai Yi-Coder-9B online free url in huggingface.co:
Yi-Coder-9B is an open source model from GitHub that offers a free installation service, and any user can find Yi-Coder-9B on GitHub to install. At the same time, huggingface.co provides the effect of Yi-Coder-9B install, users can directly use Yi-Coder-9B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.