Go to file
ViperEkura 23ce4bc3ae fix: 修复异常处理问题 2026-04-05 20:44:35 +08:00
.github Update issue templates 2026-03-31 15:20:21 +08:00
assets feat: 实现模型动态注册机制 2026-04-05 19:38:12 +08:00
astrai fix: 修复异常处理问题 2026-04-05 20:44:35 +08:00
scripts feat: 实现模型动态注册机制 2026-04-05 19:38:12 +08:00
tests feat: 实现模型动态注册机制 2026-04-05 19:38:12 +08:00
.dockerignore chore: 增加docker 配置 2026-04-04 10:59:32 +08:00
.gitattributes feat: 实现模型动态注册机制 2026-04-05 19:38:12 +08:00
.gitignore chore: 增加docker 配置 2026-04-04 10:59:32 +08:00
CONTRIBUTING.md docs: 优化文档结构并添加 GitHub 模板 2026-03-31 10:00:49 +08:00
Dockerfile chore: 修复docker配置问题 2026-04-04 11:35:14 +08:00
LICENSE Change license from Apache 2.0 to GPL v3.0 2026-02-22 21:20:34 +08:00
README.md docs: 更新说明内容 2026-03-31 15:18:49 +08:00
pyproject.toml fix: 修复工厂模式问题并增加chat-template设置 2026-04-04 12:05:05 +08:00

README.md

Logo

A lightweight Transformer training & inference framework

python license release stars forks


📖 Table of Contents

English

English

Features

  • 🚀 High Performance: Optimized for both training and inference with efficient parallelization.
  • 🔧 Flexible: Support for seq/sft/dpo training, customizable model architectures.
  • 💡 Easy to Use: Simple API with comprehensive examples and demos.
  • 📦 Lightweight: Minimal dependencies, easy to deploy.
  • 🔬 ResearchFriendly: Modular design, easy to experiment with new ideas.
  • 🤗 HuggingFace Integration: Compatible with HuggingFace models and datasets.

Quick Start

Installation

git clone https://github.com/ViperEkura/AstrAI.git
cd AstrAI
pip install -e .

For development dependencies:

pip install -e ".[dev]"

Train a Model

python scripts/tools/train.py \
  --train_type=seq \
  --data_root_path=/path/to/dataset \
  --param_path=/path/to/param_path

Generate Text

python scripts/tools/generate.py --param_path=/path/to/param_path

Demo

Check out the demos in the scripts/demo/ folder:

# Download preprocessed data (required before running demos)
python scripts/demo/download.py

# Interactive streaming chat
python scripts/demo/stream_chat.py

# Batch generation
python scripts/demo/generate_batch.py

# Autoregressive generation
python scripts/demo/generate_ar.py

Watch a video walkthrough on bilibili.

Documentation

Document Description
Parameter Guide Training & inference parameters
Design Document Framework architecture & module design
Data Flow Data processing pipeline details
Model Introduction Model architecture & technical details

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Open a Pull Request.

For major changes, please open an issue first to discuss what you would like to change.

Community

License

This project is licensed under the GPL-3.0 License.


A lightweight Transformer framework designed for both high performance and ease of use.