AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
MolCrawl is a pipeline framework to construct biological multimodal foundational models designed to handle chemical and life science data in a unified manner.
For comprehensive documentation including environment setup details, dataset guides, training configuration, evaluation procedures, experiment tracking, and more, see the Documentation Index.
Pre-trained model checkpoints for all modalities (Genome Sequence, Protein Sequence, RNA, Compounds, and Molecule-related Natural Language) are publicly available on Hugging Face:檢視完整 README ↗MolCrawl is a pipeline framework to construct biological multimodal foundational models designed to handle chemical and life science data in a unified manner.
For comprehensive documentation including environment setup details, dataset guides, training configuration, evaluation procedures, experiment tracking, and more, see the Documentation Index.
Pre-trained model checkpoints for all modalities (Genome Sequence, Protein Sequence, RNA, Compounds, and Molecule-related Natural Language) are publicly available on Hugging Face:
https://huggingface.co/collections/kojima-lab/molcrawl
You can use these checkpoints directly for inference or as starting points for fine-tuning, without running the full data preparation and training pipeline described below.
Follow these steps after cloning the repository.
git clone https://github.com/mmai-framework-lab/MolCrawl.git
cd MolCrawl
Create the directory that will store all processed data and caches.
mkdir -p learning_source
export LEARNING_SOURCE_DIR="$(pwd)/learning_source"
To make it permanent (bash example):
echo 'export LEARNING_SOURCE_DIR="$(pwd)/learning_source"' >> ~/.bashrc
Make sure this directory has at least 100GB of free space. Hugging Face cache will be stored inside ${LEARNING_SOURCE_DIR}/.cache/huggingface/.
conda config --remove channels defaults
conda config --add channels conda-forge
conda config --set channel_priority strict
conda env create --name "molcrawl" --file=environment.yaml
conda activate molcrawl
pip install --no-build-isolation -e .
The molecule_nat_lang preparation loads the GPT-2 tokenizer via
transformers.from_pretrained("gpt2"), which needs to reach Hugging Face at
runtime. On nodes that cannot reach huggingface.co this fails with a
connection error. Pre-download the tokenizer once into the directory the
workflows auto-detect (assets/tokenizers/gpt2):
huggingface-cli download openai-community/gpt2 \
config.json vocab.json merges.txt tokenizer.json tokenizer_config.json \
--local-dir assets/tokenizers/gpt2
The 01-/02-molecule_nat_lang workflow scripts export GPT2_TOKENIZER_DIR to
this path automatically when it exists; otherwise set it manually.
python -m molcrawl.preparation.preparation_script_genome_sequence assets/configs/genome_sequence.yaml
python -m molcrawl.preparation.preparation_script_protein_sequence assets/configs/protein_sequence.yaml
python -m molcrawl.preparation.preparation_script_rna assets/configs/rna.yaml
python -m molcrawl.preparation.preparation_script_compounds assets/configs/compounds.yaml
python -m molcrawl.preparation.preparation_script_molecule_nat_lang assets/configs/molecule_nat_lang.yaml
python molcrawl/data/genome_sequence/dataset/prepare_gpt2.py assets/configs/genome_sequence.yaml
python molcrawl/data/protein_sequence/dataset/prepare_gpt2.py assets/configs/protein_sequence.yaml
python molcrawl/data/rna/dataset/prepare_gpt2.py assets/configs/rna.yaml
python molcrawl/data/compounds/dataset/prepare_gpt2.py assets/configs/compounds.yaml
python molcrawl/data/molecule_nat_lang/dataset/prepare_gpt2.py assets/configs/molecule_nat_lang.yaml
Small:
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/genome_sequence/gpt2_small.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/protein_sequence/gpt2_small.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/rna/gpt2_small.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/compounds/gpt2_small.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/gpt2_small.py
Medium:
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/genome_sequence/gpt2_medium.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/protein_sequence/gpt2_medium.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/rna/gpt2_medium.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/compounds/gpt2_medium.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/gpt2_medium.py
Large:
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/genome_sequence/gpt2_large.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/protein_sequence/gpt2_large.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/rna/gpt2_large.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/compounds/gpt2_large.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/gpt2_large.py
Extra-Large (XL):
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/genome_sequence/gpt2_xl.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/protein_sequence/gpt2_xl.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/rna/gpt2_xl.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/compounds/gpt2_xl.py
python molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/gpt2_xl.py
python molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/genome_sequence/bert_small.py
python molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/protein_sequence/bert_small.py
python molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/rna/bert_small.py
python molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/compounds/bert_small.py
python molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/bert_small.py
Make sure the GPT-2 dataset preparation step (prepare_gpt2.py) has been completed before BERT training, since BERT uses the same prepared dataset format.
Both GPT-2 and BERT support Distributed Data Parallel (DDP) via torchrun (use GPU 0 and 2 on a 3-GPU machine).
# GPT2
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/genome_sequence/gpt2_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/protein_sequence/gpt2_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/rna/gpt2_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/compounds/gpt2_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/gpt2/train.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/gpt2_small.py
# BERT
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/genome_sequence/bert_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/protein_sequence/bert_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/rna/bert_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/compounds/bert_small.py
CUDA_VISIBLE_DEVICES=0,2 \
torchrun --standalone --nproc_per_node=2 \
molcrawl/models/bert/main.py molcrawl/tasks/pretrain/configs/molecule_nat_lang/bert_small.py
Effective batch size:
effective_batch_size = batch_size × gradient_accumulation_steps × num_gpus
Adjust batch_size or gradient_accumulation_steps accordingly to maintain reproducibility.
Note: Steps 4–6 can also be run collectively using the workflow scripts in the
workflows/directory. These scripts batch-process multiple modalities (data preparation, dataset building, and training) in a single command. See workflows/README.md for details.
Runs automatic evaluation on the test split, including language modeling metrics such as perplexity and token-level accuracy. It can also generate sample outputs and optionally convert the checkpoint to Hugging Face format.
python molcrawl/models/gpt2/test_checkpoint.py \
--checkpoint_path <path_to_checkpoint> \
--domain <dataset>
Optional arguments:
--max_test_samples (default: use full test set)
Limit the number of test samples for faster evaluation.
--convert_to_hf (default: False)
Convert the trained checkpoint to Hugging Face format after evaluation.
Runs evaluation on the test split using masked language modeling (MLM) metrics. It also supports prediction inspection and embedding extraction depending on configuration.
python molcrawl/models/bert/test_checkpoint.py \
--checkpoint_path <path_to_checkpoint> \
--domain <dataset>
Optional arguments:
--max_test_samples (default: use full test set)
Limit the number of test samples for faster evaluation.
--extract_embeddings (default: False)
Export hidden representations (embeddings) from the model.
--show_predictions (default: False)
Print sample masked-token predictions for qualitative inspection.
Genome Sequence
Protein Sequence (UniRef50)
RNA-seq (scRNAseq expression data)
Compounds
Molecule-related Natural Language