r/Python • u/AutoModerator • Jun 04 '26
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
27
Upvotes
r/Python • u/AutoModerator • Jun 04 '26
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
1
u/thecrypticcode Jun 16 '26
Hey everyone,
I have posted about this before, but wanted to share some updates.
Chempleter is a lightweight generative sequence model based on a multi-layer gated recurrent units (GRU) to predict syntactically valid extensions of a provided molecular fragment or bridge two molecules/molecular fragments. It operates on SELFIES token sequences, ensuring syntactically valid molecular generation and accepts SMILES notation as input. I mainly started this to learn and build something unique with PyTorch with a chemistry focus but it was a really fun project, so wanted to share if someone would like to try it out. It comes with an optional GUI :
You can now try a live demo on Huggingface. (I am really not sure how fast this will run when multiple users access it, also not optimized for mobile)
I have written the code in a fairly modular way and can be found on my GitHub.
There is also documentation about installing on your device (GPU/CPU), different inference modes and some performance/validation metrics.
Features:
extend : Takes a starting molecular structure (SMILES or SELFIES) and appends new atoms and functional groups until a complete molecule larger than the input molecule is formed.
decorate : Takes a complete molecule (SMILES) and adds a substituent at a chosen atom index. The method uses the trained model to grow fragments from the selected atom, effectively “decorating” the scaffold.
evolve: A wrapper function that calls extend multiple times in a chain. It takes the output of one extension and uses it as the input for the next, effectively “evolving” a small fragment into a complex structure over several steps.
bridge : Takes two starting molecular fragments (in SMILES notation) and predicts a bridge between them.
Limitations:
Currently, chempleter doesn't do any kind of targeted generation. It does provide some descriptors for each generated molecule which might give you an idea how "realistic" a molecule is.
As it operates on SELFIES, it will generate syntactically valid molecules but it doesn't mean that it will not generate some really absurd, funky-looking molecules (especially if you use a high temperature), for instance with high ring strain.
The GRU-based architecture may struggle to model long-range structural dependencies, and the model does not currently optimize for chemical properties, biological activity, or synthetic feasibility.
Thanks!