How biomedsciai/biomed-multi-alignment works
Project type and purpose
• This is an open-source Python library and CLI tool (“biomed-multi-alignment” / MAMMAL) providing a biomedical multi-modal foundation model.
• It supports fine-tuning and inference on tasks spanning proteins, small molecules (SMILES), single-cell gene expression, etc.
• It bundles core code (model definition, tasks, losses, schedulers, metrics), example pipelines (data modules, config files, example scripts), and CI/workflows for packaging and publication.
File structure
• Top-level directories/files
– .github/workflows: CI for testing, publishing, cloning badge
– CLONE.md, CONTRIBUTING.md, LICENSE.txt, README.md, pyproject.toml, .pre-commit-config.yaml → project metadata, packaging, code style
– tutorials/: Jupyter notebooks for “beginner” and “advanced” guides
• Core module “mammal/”
– mammal/model.py, task.py, losses.py, lr_schedulers.py, metrics.py, lora.py, keys.py → core abstractions
– mammal/main_finetune.py → CLI entry for training & evaluation pipelines
– mammal/examples/… → task-specific example subpackages, each with config.yaml, pl_data_module.py (PyTorch Lightning DataModule), task.py, main_infer.py, data/
– tests under mammal/examples/tests
• Configuration & examples
– pyproject.toml defines packaging
– Each example has a Hydra/YAML config, enabling dynamic protocol for different biomedical tasks
• External integrations
– Modular tokenizer from an external “fuse” library
– HuggingFace model hub (pre-trained weights)
– PyTorch Lightning for training loops
– Hydra for configuration
README for additional insights
• Describes MAMMAL’s architecture: aligned multi-modal tokens, prompt syntax
• Shows usage patterns: load pre-trained model + tokenizer, build prompt, run generate()
• Fine-tuning commands via main_finetune.py
• Emphasizes extensibility: adding new tasks via tutorials