wfondrie / depthcharge

A deep learning toolkit for mass spectrometry
https://wfondrie.github.io/depthcharge/
Apache License 2.0
64 stars 19 forks source link

Error in analyte decoder when tokens is None #57

Open andradesalazar opened 3 months ago

andradesalazar commented 3 months ago

Hi all,

This line here: https://github.com/wfondrie/depthcharge/blob/main/depthcharge/transformers/analytes.py#L375

causes trouble on my side when tokens is None. Probably because the token encoder expects integer tensors but in that line, the tensor is initialized by default as float.

An easy fix is probably something like this: tokens = torch.zeros(batch, 0, dtype=torch.int64)

Best, Daniela

wfondrie commented 3 months ago

This seem like a good fix to me. Can you put in a PR?