Skip to main content

SMILES-based Transformer Encoder-Decoder (SMI-TED)

This repository is a fork of the original source code and adapted for usage with HuggingFace AutoModel.

Forked GitHub: GitHub Link

Forked HuggingFace: HuggingFace Link

The original repository provides PyTorch source code associated with the publication, "A Large Encoder-Decoder Family of Foundation Models for Chemical Language".

Paper: Arxiv Link

Original GitHub: GitHub Link

Original HuggingFace: HuggingFace Link

For more information contact: eduardo.soares@ibm.com or evital@br.ibm.com.

Usage

import torch
import smi_ted
from transformers import AutoConfig, AutoModel, AutoTokenizer

config = AutoConfig.from_pretrained("bisectgroup/materials-smi-ted-fork")
tokenizer = AutoTokenizer.from_pretrained("bisectgroup/materials-smi-ted-fork")
model = AutoModel.from_pretrained("bisectgroup/materials-smi-ted-fork")

model.smi_ted.tokenizer = tokenizer
model.smi_ted.set_padding_idx_from_tokenizer()

smiles = ['CC1C2CCC(C2)C1CN(CCO)C(=O)c1ccc(Cl)cc1',
'COc1ccc(-c2cc(=O)c3c(O)c(OC)c(OC)cc3o2)cc1O',
'CCOC(=O)c1ncn2c1CN(C)C(=O)c1cc(F)ccc1-2',
'Clc1ccccc1-c1nc(-c2ccncc2)no1',
'CC(C)(Oc1ccc(Cl)cc1)C(=O)OCc1cccc(CO)n1']

with torch.no_grad():
    encoder_outputs = model.encode(smiles)
with torch.no_grad():
    decoded_smiles = model.decode(encoder_outputs)

Metadata

Release files for smi-ted 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smi-ted 1.0.0
File Size Uploaded
smi_ted-1.0.0.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smi-ted 1.0.0
File Interpreter ABI Platform
smi_ted-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / smi_ted-1.0.0.tar.gz

Download URL smi_ted-1.0.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
88e2005cdc125650073867f1a0dba8367bbb3a377ee08112e518c79b57037fa6
BLAKE2b-256 checksum
How to use checksums
38c84097ee7489251b73075312a1215a84f6de70b32770011a52daf3fa1d6b7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / smi_ted-1.0.0-py3-none-any.whl

Download URL smi_ted-1.0.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eaa8f7c4561d7bfe5e3eab9fd6ed77b115808545825ebb604900d82202dd50cd
BLAKE2b-256 checksum
How to use checksums
e948846dc706f698c2be6f190312947f2065f11c36696e765172f86ece616713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page