OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Naturalcc

NaturalCC is an open-source Python sequence-modeling toolkit for developing and evaluating machine-learning models on software-engineering tasks. It supports workflows for code generation, completion, summarization, retrieval, clone detection and type inference, and includes model-training, dataset-preprocessing and benchmarking tools.

Independent OpenViST project profile, based on linked sources.

Naturalcc — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use NaturalCC when you need a Python framework for code-model research, dataset preparation or benchmark-oriented evaluation, and can supply the model checkpoints, data and computing environment for the chosen workflow.

Who it is for

  • Researchers developing code-intelligence models and prototypes.
  • Developers building model-based workflows for code generation, completion, summarization, retrieval or clone detection.
  • Teams evaluating code models against software-engineering benchmarks.

Documented uses

  • Train custom models for code generation or completion.
  • Prepare code and documentation datasets for summarization research.
  • Build and evaluate code retrieval or clone-detection experiments.
  • Prototype type-inference models.
Before you choose

Requirements & limits

The repository is public and identifies NaturalCC as open source under the MIT license.

  • The README specifies Python 3.6 or later, PyTorch 1.4 or later and GCC/G++ 5.0 or later.
  • NVIDIA GPU, NCCL and CUDA Toolkit are optional but recommended for training new models; NVIDIA Apex is optional for faster training.
  • The repository describes support for Code Llama, CodeT5, CodeGen and StarCoder.
  • A Hugging Face token is required for certain models, including StarCoder.
  • The documented generation example expects a downloaded checkpoint, a JSON prompt dataset and a CUDA device.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Run the documented code-generation example

Use a downloaded model checkpoint and JSON prompt dataset with NaturalCC’s generation task to save generated code results.

Before you start

  • NaturalCC installed with its listed Python requirements and additional dependencies.
  • A downloaded compatible model checkpoint; the README example uses CodeLlama-7B.
  • A JSON dataset containing test cases with an input field.
  • A CUDA device, as specified in the example task initialization.

Steps

  1. Download a model checkpoint and prepare a JSON file of code prompts.

  2. Initialize GenerationTask with the documented task name and CUDA device.

  3. Load the checkpoint with from_pretrained and the JSON file with load_dataset.

  4. Call task.run with an output path, batch_size=1 and max_length=50.

Expected outcome

The example writes generation results to the specified output file.

Guide limitations

  • The example requires users to provide the checkpoint, dataset path and output path.
  • The README specifies a CUDA device for this example; GPU, NCCL and CUDA are listed as optional but recommended for training new models.
Source-based practical guide

Prepare the documented Python summarization dataset

Download, clean and preprocess the Python WAN dataset for the repository’s summarization workflow.

Before you start

  • NaturalCC repository cloned locally.
  • The Python environment and dependencies described in the repository installation instructions.

Steps

  1. Run the Python WAN dataset download script.

  2. Run the dataset cleaning module.

  3. Run the attributes-cast module.

  4. Run the summarization preprocessing module to save code and docstring tokens in MMAP format.

Expected outcome

The documented dataset preparation steps produce cleaned and converted data, including MMAP-formatted code and docstring tokens.

COMPARE OPTIONS

Compare options for Model inference and serving

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
NaturalccTrain custom models for code generation or completion.Linux, macOS, WindowsThe repository is public and identifies NaturalCC as open source under the MIT license.
HyperposeCustomize pose-estimation architectures and datasets.Docker, Linux, macOS, Windows
Multi Task NlpDefine multiple tasks and their data and model settings in a YAML file.Linux, macOS, WindowsThe project is an open-source library under the Apache-2.0 license, distributed through its public GitHub repository.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
CGCL-codes/naturalcc · Official homepage title · retained in its source language