Downloads · 30 days
11
0% of all-time downloads
Huhujingjing/custom-mxm
custom-mxm is a graph machine learning model from Huhujingjing. Use it for the graph machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
11
0% of all-time downloads
All-time downloads
4.2K
Public
Repo size
14.8 MB
Likes
0
Public
Click a slice to open those files.
.bin14.8 MB · 100%
From the Hugging Face model README
pip install transformers gradio rdkit torch
pip install torch_scatter torch_sparse torch_geometric
import gradio as gr
from transformers import AutoModel
def predict_smiles(name):
device = 'cpu'
smiles = name
assert isinstance(smiles, str), 'smiles must be str'
smiles = smiles.strip()
if ';' in smiles:
smiles = smiles.split(";")
elif ' ' in smiles:
smiles = smiles.split(" ")
elif ',' in smiles:
smiles = smiles.split(",")
else:
smiles = [smiles]
model = AutoModel.from_pretrained("Huhujingjing/custom-mxm", trust_remote_code=True).to(device)
output, df = model.predict_smiles(smiles)
return output, df
iface = gr.Interface(fn=predict_smiles, inputs="text", outputs=["text", "dataframe"])
iface.launch(share=True)