Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to implement a simple inference? #287

Open
18930215187 opened this issue Nov 1, 2024 · 3 comments
Open

How to implement a simple inference? #287

18930215187 opened this issue Nov 1, 2024 · 3 comments

Comments

@18930215187
Copy link

18930215187 commented Nov 1, 2024

How to implement a simple inference process with uni-mol2? I want to input only a SMILES sequence and get the output from the trunk network (features), without involving the head network in any specific tasks.

@dalessioluca
Copy link

Is there any update on this?
uni-mol2 seems an wonderful model and we are all eager to try it on different tasks.

Thanks!

@Naplessss
Copy link
Collaborator

@dalessioluca
Copy link

dalessioluca commented Jan 3, 2025

This branch must have been merged to main.
Right now you can extract the representations from unimol2 using unimol_tools with the code below:

params = {
        'data_type': 'molecule',
        'remove_hs': False,
        'model_name': 'unimolv2',
        'model_size': '84m',
}
smiles_list = ["C(=O)=O", "[C-]#[O+]"]
clf = UniMolRepr(use_gpu=use_gpu, **params)
unimol_repr = clf.get_repr(data=smiles_list, return_atomic_reprs=False)
cls_repr = numpy.array(unimol_repr["cls_repr"])
N, D = cls_repr.shape
assert len(smiles_list) == N

Thanks for the nice job releasing and maintaining this model!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants