Skip to content

Commit

Permalink
debug -- use tokenizer dataset function
Browse files Browse the repository at this point in the history
  • Loading branch information
amva13 committed Oct 25, 2024
1 parent 7f21f3b commit 91e5087
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tdc/test/test_model_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ def testGeneformerTokenizer(self):
assert cells, "FAILURE: cells false-like. Value is = {}".format(cells)
assert len(cells) > 0, "FAILURE: length of cells <= 0 {}".format(cells)
from tdc import tdc_hf_interface
# import torch
import torch
geneformer = tdc_hf_interface("Geneformer")
model = geneformer.load()
tokenized_data = tokenizer.create_dataset(cells, metadata)
out = model(tokenized_data)
input_tensor = torch.squeeze(tokenized_data)
try:
out = model(tokenized_data)
except Exception as e:
raise Exception("tensor shape is", input_tensor.shape, "exception was:", e)
# input_tensor = torch.tensor(cells)
# input_tensor_squeezed = torch.squeeze(input_tensor)
# x = input_tensor_squeezed.shape[0]
Expand Down

0 comments on commit 91e5087

Please sign in to comment.