THUDM / codegeex4-all-9b

huggingface.co
Total runs: 661
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: July 18 2024
text-generation

Introduction of codegeex4-all-9b

Model Details of codegeex4-all-9b

CodeGeeX4: Open Multilingual Code Generation Model

CodeGeeX4

中文

GitHub

We introduce CodeGeeX4-ALL-9B, the open-source version of the latest CodeGeeX4 model series. It is a multilingual code generation model continually trained on the GLM-4-9B , significantly enhancing its code generation capabilities. Using a single CodeGeeX4-ALL-9B model, it can support comprehensive functions such as code completion and generation, code interpreter, web search, function call, repository-level code Q&A, covering various scenarios of software development. CodeGeeX4-ALL-9B has achieved highly competitive performance on public benchmarks, such as BigCodeBench and NaturalCodeBench . It is currently the most powerful code generation model with less than 10B parameters, even surpassing much larger general-purpose models, achieving the best balance in terms of inference speed and model performance.

Get Started

Use 4.39.0<=transformers<=4.40.2 to quickly launch codegeex4-all-9b

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained("THUDM/codegeex4-all-9b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    "THUDM/codegeex4-all-9b",
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True
).to(device).eval()
inputs = tokenizer.apply_chat_template([{"role": "user", "content": "write a quick sort"}], add_generation_prompt=True, tokenize=True, return_tensors="pt", return_dict=True ).to(device)
with torch.no_grad():
    outputs = model.generate(**inputs, max_length=256)
    outputs = outputs[:, inputs['input_ids'].shape[1]:]
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))

If you want to build the chat prompt manually, please make sure it follows the following format:

f"<|system|>\n{system_prompt}\n<|user|>\n{prompt}\n<|assistant|>\n"

Default system_prompt:

你是一位智能编程助手,你叫CodeGeeX。你会为用户回答关于编程、代码、计算机方面的任何问题,并提供格式规范、可以执行、准确安全的代码,并在必要时提供详细的解释。

The English version:

You are an intelligent programming assistant named CodeGeeX. You will answer any questions users have about programming, coding, and computers, and provide code that is formatted correctly.

For infilling ability, please use (without system prompt):

f"<|user|>\n<|code_suffix|>{suffix}<|code_prefix|>{prefix}<|code_middle|><|assistant|>\n"

Additional infos (like file path, programming language, mode) can be added. Example:

<|user|>
###PATH:src/example.py
###LANGUAGE:Python
###MODE:BLOCK
<|code_suffix|>{suffix}<|code_prefix|>{prefix}<|code_middle|><|assistant|>
Evaluation
Model Seq Length HumanEval MBPP NCB LCB HumanEvalFIM CRUXEval-O
Llama3-70B-intruct 8K 77.4 82.3 37.0 27.4 - -
DeepSeek Coder 33B Instruct 16K 81.1 80.4 39.3 29.3 78.2 49.9
Codestral-22B 32K 81.1 78.2 46.0 35.3 91.6 51.3
CodeGeeX4-All-9B 128K 82.3 75.7 40.4 28.5 85.0 47.1
License

The model weights are licensed under the following License .

Citation

If you find our work helpful, please feel free to cite the following paper:

@inproceedings{zheng2023codegeex,
  title={CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X},
  author={Qinkai Zheng and Xiao Xia and Xu Zou and Yuxiao Dong and Shan Wang and Yufei Xue and Zihan Wang and Lei Shen and Andi Wang and Yang Li and Teng Su and Zhilin Yang and Jie Tang},
  booktitle={Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  pages={5673--5684},
  year={2023}
}

Runs of THUDM codegeex4-all-9b on huggingface.co

661
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About codegeex4-all-9b huggingface.co Model

More codegeex4-all-9b license Visit here:

https://choosealicense.com/licenses/codegeex4

codegeex4-all-9b huggingface.co

codegeex4-all-9b huggingface.co is an AI model on huggingface.co that provides codegeex4-all-9b's model effect (), which can be used instantly with this THUDM codegeex4-all-9b model. huggingface.co supports a free trial of the codegeex4-all-9b model, and also provides paid use of the codegeex4-all-9b. Support call codegeex4-all-9b model through api, including Node.js, Python, http.

codegeex4-all-9b huggingface.co Url

https://huggingface.co/THUDM/codegeex4-all-9b

THUDM codegeex4-all-9b online free

codegeex4-all-9b huggingface.co is an online trial and call api platform, which integrates codegeex4-all-9b's modeling effects, including api services, and provides a free online trial of codegeex4-all-9b, you can try codegeex4-all-9b online for free by clicking the link below.

THUDM codegeex4-all-9b online free url in huggingface.co:

https://huggingface.co/THUDM/codegeex4-all-9b

codegeex4-all-9b install

codegeex4-all-9b is an open source model from GitHub that offers a free installation service, and any user can find codegeex4-all-9b on GitHub to install. At the same time, huggingface.co provides the effect of codegeex4-all-9b install, users can directly use codegeex4-all-9b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

codegeex4-all-9b install url in huggingface.co:

https://huggingface.co/THUDM/codegeex4-all-9b

Url of codegeex4-all-9b

codegeex4-all-9b huggingface.co Url

Provider of codegeex4-all-9b huggingface.co

THUDM
ORGANIZATIONS

Other API from THUDM

huggingface.co

Total runs: 659.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 05 2024
huggingface.co

Total runs: 611.5K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 04 2024
huggingface.co

Total runs: 243.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:March 11 2025
huggingface.co

Total runs: 95.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:March 13 2025
huggingface.co

Total runs: 69.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 23 2024
huggingface.co

Total runs: 28.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:March 03 2025
huggingface.co

Total runs: 23.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 23 2024
huggingface.co

Total runs: 15.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:April 14 2025
huggingface.co

Total runs: 6.5K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 19 2023
huggingface.co

Total runs: 6.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 25 2024
huggingface.co

Total runs: 4.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:April 22 2025
huggingface.co

Total runs: 3.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:January 02 2025
huggingface.co

Total runs: 2.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 04 2024
huggingface.co

Total runs: 993
Run Growth: 0
Growth Rate: 0.00%
Updated:October 20 2023
huggingface.co

Total runs: 928
Run Growth: 0
Growth Rate: 0.00%
Updated:October 20 2023
huggingface.co

Total runs: 853
Run Growth: 0
Growth Rate: 0.00%
Updated:January 27 2025
huggingface.co

Total runs: 607
Run Growth: 0
Growth Rate: 0.00%
Updated:January 02 2025
huggingface.co

Total runs: 299
Run Growth: 0
Growth Rate: 0.00%
Updated:March 02 2023
huggingface.co

Total runs: 188
Run Growth: 0
Growth Rate: 0.00%
Updated:August 04 2024
huggingface.co

Total runs: 167
Run Growth: 0
Growth Rate: 0.00%
Updated:October 20 2023
huggingface.co

Total runs: 119
Run Growth: 0
Growth Rate: 0.00%
Updated:December 10 2024
huggingface.co

Total runs: 75
Run Growth: 0
Growth Rate: 0.00%
Updated:November 20 2023
huggingface.co

Total runs: 62
Run Growth: 0
Growth Rate: 0.00%
Updated:July 09 2025
huggingface.co

Total runs: 43
Run Growth: 0
Growth Rate: 0.00%
Updated:July 09 2025
huggingface.co

Total runs: 43
Run Growth: 0
Growth Rate: 0.00%
Updated:July 24 2023
huggingface.co

Total runs: 28
Run Growth: 0
Growth Rate: 0.00%
Updated:July 09 2025
huggingface.co

Total runs: 25
Run Growth: 0
Growth Rate: 0.00%
Updated:March 02 2023
huggingface.co

Total runs: 14
Run Growth: 0
Growth Rate: 0.00%
Updated:July 24 2023
huggingface.co

Total runs: 12
Run Growth: 0
Growth Rate: 0.00%
Updated:July 22 2024