Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
amva13 committed Oct 23, 2024
1 parent bdce943 commit c388e35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tdc/model_server/tokenizers/geneformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ def tokenize_cell_vectors(self,
X_norm = (X_view / n_counts * target_sum / norm_factor_vector)
X_norm = sp.csr_matrix(X_norm)

tokenized_cells += [
tokenized_cells.append([
self.rank_genes(X_norm[i].data,
coding_miRNA_tokens[X_norm[i].indices])
for i in range(X_norm.shape[0])
]
])

# add custom attributes for subview to dict
if self.custom_attr_name_dict is not None:
Expand Down
3 changes: 2 additions & 1 deletion tdc/test/test_model_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def testGeneformerTokenizer(self):
geneformer = tdc_hf_interface("Geneformer")
model = geneformer.load()
input_tensor = torch.tensor(cells)
raise Exception("shape is", input_tensor.shape, "values are\n", input_tensor)
input_tensor = torch.squeeze(input_tensor)
# raise Exception("shape is", input_tensor.shape, "values are\n", input_tensor)
out = model(input_tensor)
assert out, "FAILURE: Geneformer output is false-like. Value = {}".format(out)
assert len(out) == len(cells), "FAILURE: Geneformer output and cells input don't have the same length. {} vs {}".format(len(out), len(cells))
Expand Down

0 comments on commit c388e35

Please sign in to comment.