Skip to content

Latest commit

Β 

History

History
104 lines (77 loc) Β· 3.09 KB

File metadata and controls

104 lines (77 loc) Β· 3.09 KB

ACToR

SVG Banners

ACToR is an Adaptive Critical Token-aware Retrieval framework designed for repository-level code generation tasks.

🎯 Overview

Architecture Overview


πŸ“ Project Structure

ACToR/
β”œβ”€β”€ README.md                # Project documentation
β”œβ”€β”€ classifiers/             # Critical Token classifiers 
β”œβ”€β”€ weights/                 # Position-aware weights
β”œβ”€β”€ datasets/                # Benchmarks and training datasets
β”œβ”€β”€ repositories/            # Code repositories for training and testing
└── src/                     # Source code directory
    β”œβ”€β”€ pipeline.py
    β”œβ”€β”€ critoken.py
    β”œβ”€β”€ train.py
    β”œβ”€β”€ data/                # Data processing pipeline
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ repo.py
    β”‚   β”œβ”€β”€ task.py
    β”‚   └── process/         # Data processing modules
    β”‚       β”œβ”€β”€ __init__.py
    β”‚       β”œβ”€β”€ data.py
    β”‚       β”œβ”€β”€ window.py
    β”‚       β”œβ”€β”€ vector.py
    β”‚       β”œβ”€β”€ search.py
    β”‚       β”œβ”€β”€ prompt.py
    β”‚       └── utils.py
    └── server/              # Model server integration
        β”œβ”€β”€ __init__.py
        β”œβ”€β”€ classifier.py
        └── llm.py

πŸ› οΈ Quick Start

1. Prerequisites & Installation

Requirements:

  • Python 3.12.11 (recommended)

Installation:

pip install -r requirements.txt

2. Repository Setup

Organize code repositories in the repositories/ directory following this structure:

repositories/
β”œβ”€β”€ codereval/
β”‚   └── python/              # CoderEval Python repositories
β”œβ”€β”€ repoexec/
β”‚   └── test-app/            # RepoExec test repositories
└── repost/
    └── train/               # RepoST training repositories

Setup Instructions:

  1. CoderEval: Clone CoderEval Python repositories to repositories/codereval/python/
  2. RepoExec: Clone RepoExec test repositories to repositories/repoexec/test-app/
  3. RepoST: Clone RepoST training repositories to repositories/repost/train/ (for training reproduction)

Note: More Details are available in src/data/process/utils.py

⚑ Usage

  1. Repo Context Prep
python src/pipeline.py repo --benchmark 'repoexec' # alternative 'codereval-python', 'repost_train'
  1. (Optional) Training Data Prep
python src/pipeline.py train --task_type 'data' --model_name 'model_name' # e.g. codellama-7b-hf
  1. (Optional) Classifier Training
python src/pipeline.py train --task_type 'classifier' --model_name 'model_name' # e.g. codellama-7b-hf
  1. Run Adaptive Critical Token-aware Retrieval augmented generation.
python src/pipeline.py task token --model_name 'model_name' --benchmark 'repoexec'