LegoGPT

Installation

Prerequisites

You need a Gurobi licence to use Gurobi for stability analysis. Get a free academic licence here.

Installing as a standalone project

This repo uses the Python project manager uv. To install this repo as a standalone project:

  1. Clone the repo: git clone "git@github.com:AvaLovelace1/LegoGPT.git" && cd LegoGPT.
  2. Some files in the ImportLDraw submodule (required for rendering LEGO visualizations) are stored using the Git LFS system. To download these files, install Git LFS, cd into the ImportLDraw directory, and run git lfs pull.
  3. Finally, install uv. A virtual environment will be created, and the remaining dependencies installed automatically, upon invoking uv run [SCRIPT_NAME].

Installing as a package

To install this repo as a package in your own Python project, run

uv add "git+ssh://git@github.com/AvaLovelace1/LegoGPT.git"

if using uv, or

pip install "git+ssh://git@github.com/AvaLovelace1/LegoGPT.git"

if using pip.

Finetuning

uv run accelerate config  # Initialize the Accelerate config file
uv run ./finetune.zsh

Running inference interactively

Run inference with an interactive CLI using:

uv run infer --model_name_or_path MODEL_PATH

See uv run infer -h for a full list of options.

S
Description
Official repository for LegoGPT, the first approach for generating physically stable LEGO brick models from text prompts.
Readme MIT 249 MiB
Languages
Python 99.5%
Shell 0.5%