Skip to content

Generation

The generation pipeline constructs prompts, generates CIFs, post-processes the results, and ranks candidate structures.

Each stage is exposed as a standalone command. The corresponding module docstrings provide representative Usage: commands.

The _load_and_generate command combines the generation workflow and is documented on the CLI entry points page.

Prompts

make_prompts

Build generation prompts for conditional and unconditional models.

Prompts can be extracted from CIF data or constructed from compositions and target properties. Conditioning levels range from an unconditional prompt to prompts containing composition, atomic information, and space group. Manual mode supports cartesian, paired, and broadcast composition-to-condition mappings.

Each --condition_lists argument is one complete condition vector for a sample. For example, "1.8,0.0" "2.0,0.0" represents two condition vectors, not four.

Usage
python _utils/_generating/make_prompts.py --HF_dataset "c-bone/mpdb-2prop_clean" \
    --split test --automatic --level level_3 --output_parquet prompts.parquet

Generating CIFs

generate_cifs

Generate CIF structures across GPU workers with validation and optional ranking.

Candidates are validated and surviving structures can be ranked by model perplexity or XRD fit before selection. The workflow accepts already-built prompts and can resolve a run directory to its newest checkpoint.

Usage
python _utils/_generating/generate_cifs.py \
    --config _config_files/generation/conditional/slme/slme-PKV-opt_eval.jsonc

Post-processing

postprocess

Clean and validate generated CIF strings in a parquet dataset.

Each CIF is rewritten into the standard-compliant representation expected by the metrics scripts.

Usage
python _utils/_generating/postprocess.py --input_parquet gen.parquet \
    --output_parquet gen_post.parquet

Ranking candidates

scoring_methods

Provide ranking strategies for generated CIF candidates.

Log-probability ranking measures model output likelihood and applies to all model families.