Skip to content

Installation

This guide walks you through setting up VietQuill in your Python environment.

Prerequisites

  • Python: >= 3.10
  • PyTorch: >= 2.0.0 (with CUDA support recommended for GPU acceleration)

Basic Installation

You can install VietQuill directly from PyPI using pip:

pip install vietquill

Or install in editable mode from source:

git clone https://github.com/ngwgsang/vietquill.git
cd vietquill
pip install -e .

Installing Optional Documentation Dependencies

If you wish to build or preview this documentation locally:

pip install "vietquill[docs]"

Or manually:

pip install mkdocs-material "mkdocstrings[python]" mkdocs-autorefs "pymdown-extensions<12"

Then preview with mkdocs serve.

Note

pymdown-extensions 12 is not yet compatible with mkdocstrings (Highlight.__init__() missing 1 required positional argument: 'md'), so it is pinned below 12.

GPU Acceleration Setup (PyTorch with CUDA)

VietQuill models use Seq2Seq transformers (such as ViT5) and neural estimators (vELECTRA). A CUDA-enabled GPU significantly speeds up inference.

If you have an NVIDIA GPU, install the appropriate PyTorch build according to your CUDA driver:

# Example for CUDA 12.1
pip install torch --index-url https://download.pytorch.org/whl/cu121

Verify your GPU is available:

import torch
print(f"CUDA Available: {torch.cuda.is_available()}")
if torch.cuda.is_available():
    print(f"Device Name: {torch.cuda.get_device_name(0)}")

VietQuill automatically selects cuda if available, and falls back to cpu otherwise.