Instructions to use Delower/molmistral-foundation-v61 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Delower/molmistral-foundation-v61 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Delower/molmistral-foundation-v61") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
foundation β model bundle
Raw small-molecule foundation model (causal LM over SMILES). Pretrained on general molecules only β NO DPP-4 data, no property conditioning. Decontaminated against the DPP-4 fine-tune set and the 12 FDA gliptins.
Use it for: Fine-tune this on a new target/disease, or sample general drug-like SMILES from it.
Files
| File | What it is |
|---|---|
model.keras |
the weights (whole Keras 3 model), best by val loss |
vocab.txt |
621 tokens in id order |
tokenizer_config.json |
ids, property tokens, bins, max lengths |
model_config.json |
architecture, provenance, dependencies |
history.csv |
per-epoch loss / accuracy / perplexity |
metrics.json |
stage metrics (if the stage produced them) |
infer_from_bundle.py |
generate SMILES from this bundle |
finetune_from_foundation.py |
fine-tune this bundle on a new target |
train_llm_foundation.py |
module the two helpers import |
MANIFEST.json |
sha256 + size of every file here |
Inference
pip install "tensorflow==2.17.0" "keras==3.5.0" "keras-nlp==0.15.1" rdkit pandas
python infer_from_bundle.py --bundle . --n 1000 --out generated.csv
Add --condition POTENT,MW_350_400,LOGP_1_2,HBD_1,HBA_5_6,TPSA_90_120,ROT_4_6
for a property-conditioned run (fine-tuned bundle only; the foundation model
ignores conditioning because it never saw those tokens).
Fine-tuning this on another disease
Only the foundation bundle should be the starting point for a new target β
starting from finetuned_dpp4 would carry DPP-4 bias into the new target.
python finetune_from_foundation.py \
--bundle /path/to/foundation \
--csv my_target_actives.csv \ # columns: smiles[, pIC50][, source]
--out_dir ./runs_mytarget \
--epochs 30 --patience 4
It reuses this bundle's tokenizer unchanged (same 621-token vocab, same
property tokens), so no vocabulary surgery is needed, and it writes a new
bundle at ./runs_mytarget/model_weights/finetuned_<name>/ in this same
layout.
Hard rule carried over from the DPP-4 run: keep the new target's actives out of any pretraining data, and keep reference/approved drugs in the train split so the model actually learns them.
- Downloads last month
- 17