From ece3a086f7250976f62b79ac77fea3f59dcd70a8 Mon Sep 17 00:00:00 2001 From: Alejandro Velez-Arce Date: Sat, 26 Oct 2024 11:22:32 -0400 Subject: [PATCH] make all tokenized cells be the confirmed pkl values --- tdc/test/test_model_server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tdc/test/test_model_server.py b/tdc/test/test_model_server.py index 146865c7..ca3f976a 100644 --- a/tdc/test/test_model_server.py +++ b/tdc/test/test_model_server.py @@ -7,6 +7,7 @@ import shutil import pytest import mygene +import numpy as np # temporary solution for relative imports in case TDC is not installed # if TDC is installed, no need to use the following line @@ -106,10 +107,10 @@ def testGeneformerTokenizer(self): print("using very few genes for these test cases so expecting empties... let's pad/remove just for the test case...") for idx in range(len(cells)): x = cells[idx] - if len(x)<2: - for _ in range(2-len(x)): - x.append(1) - cells[idx] = x + for j in range(len(x)): + v = x[j] + if len(v) < 2: + cells[idx][j] = [16162, 10576] # confirmed tokenizer values from pkl dict input_tensor = torch.tensor(cells) # input_tensor = torch.squeeze(input_tensor) try: