CodeGeeX2  by zai-org

Multilingual code generation model, CodeGeeX2

created 2 years ago
7,616 stars

Top 7.0% on sourcepulse

GitHubView on GitHub
Project Summary

CodeGeeX2 is a powerful, multilingual code generation model designed for developers seeking enhanced code completion, explanation, translation, and debugging capabilities. It offers significant performance improvements over its predecessor, making AI-assisted coding more accessible and efficient.

How It Works

CodeGeeX2 builds upon the ChatGLM2 architecture, incorporating extensive code pre-training on 600 billion tokens. This approach leverages ChatGLM2's efficient design and extends its capabilities specifically for code-related tasks. Key advantages include its 6B parameter size, which outperforms larger models like StarCoder-15B, and its optimized architecture supporting an 8192 token sequence length and faster inference.

Quick Start & Requirements

  • Install/Run: Use transformers library:
    from transformers import AutoTokenizer, AutoModel
    tokenizer = AutoTokenizer.from_pretrained("THUDM/codegeex2-6b", trust_remote_code=True)
    model = AutoModel.from_pretrained("THUDM/codegeex2-6b", trust_remote_code=True, device='cuda')
    
  • Prerequisites: Python, transformers, CUDA (for GPU acceleration). For bfloat16 support, a compatible GPU is needed; otherwise, use .half().cuda() for float16.
  • Resources: Quantized versions require as little as 6GB VRAM.
  • Docs: CodeGeeX Homepage

Highlighted Details

  • Achieves 35.9% Pass@1 on HumanEval-X (Python), surpassing StarCoder-15B.
  • Supports over 100 programming languages via IDE plugins (VS Code, Jetbrains).
  • Offers features like context-aware completion and cross-file completion.
  • Quantized to INT4 requires only 5.5 GB VRAM.

Maintenance & Community

  • Developed by THUDM.
  • Latest generation CodeGeeX4 is also available.
  • Community discussion via WeChat group (link in README).

Licensing & Compatibility

  • Code is licensed under Apache-2.0.
  • Model weights require adherence to the Model License. Academic research is fully open; commercial use requires application.

Limitations & Caveats

  • The base CodeGeeX2-6B model is for code generation, not chat. For conversational AI programming assistance, use the provided IDE plugins.
  • Optimal performance requires specific prompt formatting, including language tags (e.g., # language: Python).
Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
33 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
6 more.

codellama by meta-llama

0.1%
16k
Inference code for CodeLlama models
created 1 year ago
updated 11 months ago
Feedback? Help us improve.