How salesforce/progen works
Project type and purpose
• ProGen is an open-source Python toolkit for protein engineering that provides:
• Pretrained language models under progen2/models/progen
• Tokenization via progen2/tokenizer.json
• Two “use-case” scripts: sample.py (sequence generation) and likelihood.py (fitness or log-likelihood scoring)
• It is not a web app or microservices architecture but rather a stand-alone library/tool intended to be embedded in research or automation pipelines.
File structure
Top-level:
• Configuration and policy files (LICENSE.txt, CODE_OF_CONDUCT.md, SECURITY.md, etc.)
• A root README.md describing the overall project
progen2/ directory:
• requirements.txt – lists Python dependencies (e.g., PyTorch, HuggingFace Transformers)
• tokenizer.json – Byte-pair encoding or tokenizer vocabulary for protein sequences
• models/progen/ – two core modules:
– configuration_progen.py (model hyperparameters, architecture definitions)
– modeling_progen.py (PyTorch model classes, forward pass, generation/ scoring API)
• sample.py – CLI or script entrypoint for sequence sampling
• likelihood.py – CLI or script entrypoint for scoring sequences
README for additional insights
• Implied workflow: load a model → tokenize input or generate new sequences → score or output them.
Elements
[sample.py] [likelihood.py] → [Tokenizer] → [Model Config] → [Model Class] → [Output]
(PyTorch), (HuggingFace Transformers)
e.g., “sequence string” → Tokenizer → “token IDs” → Model → “scores/sequences”
• Blue for user-facing scripts
• Green for core library modules
• Orange for external dependencies