The aiXcoder-7B Code Large Language Model is an advanced tool designed to assist developers with code comprehension and generation across various programming languages. This guide will walk you through the setup process, usage, and troubleshooting tips to ensure a smooth experience.
Model Introduction
The aiXcoder-7B model has been meticulously trained on 1.2 trillion unique tokens, making it one of the most powerful models for code-related tasks. It excels in code completion and generation, outperforming many mainstream models in the multilingual nl2code benchmark. While currently not optimized for specialized tasks like test case generation and debugging, future updates aim to close this gap.
Quickstart
Environment Requirements
- Option 1: Build Env
- Python 3.8 or higher
- PyTorch 2.1.0 or higher
- sentencepiece 0.2.0 or higher
- transformers 4.34.1 or higher
- Option 2: Docker
- Docker installed on your machine.
Model Weights
You can download the model weights from the following link: aiXcoder Base Download. The Instruct version will be available soon.
Installation Instructions
To install the aiXcoder-7B model:
conda create -n aixcoder-7b python=3.11
conda activate aixcoder-7b
git clone git@github.com:aixcoder-plugin/aiXcoder-7b.git
cd aiXcoder-7b
pip install -r requirements.txt
To speed up inference, especially for large models, consider installing Flash Attention:
git clone git@github.com:Dao-AILab/flash-attention.git
cd flash-attention
MAX_JOBS=8 python setup.py install
Inference Example
The following analogy will help you visualize how to use the code completion feature:
Imagine aiXcoder-7B as a highly skilled assistant who understands programming languages. When you ask this assistant to help you with a coding task, it can complete your unfinished code, much like how a friend would complete your sentences when you are stuck.
Command Line Execution
To run the model from the command line:
torchrun --nproc_per_node 1 sess_megatron.py --model_dir path_to_model_weights_dir
Python Script Execution
For programmatic access, here’s how to call the model within your own Python script:
from sess_megatron import TestInference
infer = TestInference()
res = infer.run_infer(code_string=..., later_code=..., file_path='test.py', max_new_tokens=256)
print(res)
License
The model weights are licensed for academic research use under the Model License. For commercial use, please contact support@aiXcoder.com.
Troubleshooting
If you encounter issues while setting up or using aiXcoder-7B, here are a few troubleshooting tips:
- Ensure all prerequisite software versions are installed correctly.
- Check the paths provided in the commands for any typos or mistakes.
- If using Docker, ensure your GPU drivers are compatible with the Docker image.
For further assistance, please explore more resources or community engagement at fxis.ai.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Acknowledgments
We extend our gratitude to all contributors whose support and involvement have made the development of aiXcoder-7B possible. Thank you for your interest and contributions!