Spaces:
Running
on
A10G
title: BrickGPT-Demo
emoji: 🧱
colorFrom: green
colorTo: yellow
license: mit
short_description: Generate stable toy brick structures from text prompts.
app_file: app.py
sdk: gradio
sdk_version: 5.49.1
python_version: 3.10.13
models:
- AvaLovelace/BrickGPT
pinned: true
thumbnail: >-
https://cdn-uploads.huggingface.co/production/uploads/672403d5f328a3e6638331ee/H66Srg95-N--44lg9-4dX.png
BrickGPT Demo
Gradio demo for BrickGPT.
Prerequisites
Llama-3.2-1B-Instruct: BrickGPT is fine-tuned from meta-llama/Llama-3.2-1B-Instruct, a gated model. Request access to the model here, then generate a Hugging Face user access token.
- If running locally, set your access token as an environment variable:
export HF_TOKEN=<your_token> - If running on Hugging Face Spaces, set your access token as the
HF_TOKENsecret in the Settings tab of your Space.
The model will be automatically downloaded upon running the code.
- If running locally, set your access token as an environment variable:
Gurobi: Running stability analysis requires a Gurobi licence to use Gurobi. Academics may request a free licence from the Gurobi website here.
- If running locally, place the Gurobi licence file in your home directory or another recommended location.
- If running on Hugging Face Spaces, the licence type must be Web License Service (WLS). Set the
WLSACCESSID,WLSSECRET, andLICENSEIDsecrets in the Settings tab of your Space to their values in your Gurobi licence file.
ImportLDraw: Rendering brick visualizations requires ImportLDraw, provided as a Git submodule.
- If running locally, follow these instructions to install ImportLDraw:
- Download Git LFS, then run
git lfs install. - Install Git submodules with
git submodule update --init. - Download the LDraw parts library and
extract it in your home directory:
(cd ~ && wget https://library.ldraw.org/library/updates/complete.zip && unzip complete.zip).- If you wish to put the LDraw parts library in a different directory, set the environment variable
LDRAW_LIBRARY_PATHto the path of theldrawdirectory:export LDRAW_LIBRARY_PATH=path/to/ldraw.
- If you wish to put the LDraw parts library in a different directory, set the environment variable
- Download Git LFS, then run
- If running on Hugging Face Spaces, ImportLDraw and the LDraw parts library will automatically be downloaded and
installed by the
app.pyscript.
- If running locally, follow these instructions to install ImportLDraw:
Running locally
Install the Python project manager uv. Then run the demo with:
uv run app.py
Running on Hugging Face Spaces
Make sure the origin of this repo is set to your Space:
git remote set-url origin git@hf.co:spaces/<your_username>/<your_space_name>
Then commit and push your changes to your Space with
git add -A && git commit -m "Update" && git push
If you've changed the dependencies in
pyproject.toml, update therequirements.txtfile accordingly:uv export --format requirements-txt --no-hashes > requirements.txtThen,
git commitandgit pushthe changes to your Space. You may have to restart the Space for the changes to take effect.