Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Geneformer server #326

Merged
merged 27 commits into from
Oct 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
debug -- use tokenizer dataset function
amva13 committed Oct 25, 2024
commit 91e5087e320d5bef3e86ebaae40b7897c9cffc85
8 changes: 6 additions & 2 deletions tdc/test/test_model_server.py
Original file line number Diff line number Diff line change
@@ -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]