Skip to content

Commit

Permalink
huggingface geneformer
Browse files Browse the repository at this point in the history
  • Loading branch information
amva13 committed Oct 26, 2024
1 parent 08db3c4 commit 5f14c49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
- torchvision==0.16.1
- transformers==4.43.4
- yapf==0.40.2
- git+https://github.com/amva13/geneformer.git@main#egg=geneformer
- git+https://huggingface.co/ctheodoris/Geneformer.git@main#egg=geneformer

variables:
KMP_DUPLICATE_LIB_OK: "TRUE"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ tiledbsoma>=1.7.2,<2.0.0
yapf>=0.40.2,<1.0.0

# github packages
git+https://github.com/amva13/geneformer.git@main#egg=geneformer
git+https://huggingface.co/ctheodoris/Geneformer.git@main#egg=geneformer
7 changes: 4 additions & 3 deletions tdc/test/test_model_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ def testGeneformerTokenizer(self):
geneformer = tdc_hf_interface("Geneformer")
model = geneformer.load()
tokenized_data = tokenizer.create_dataset(cells, metadata)
input_tensor = torch.tensor(tokenized_data)
input_tensor = torch.squeeze(input_tensor)
# input_tensor = torch.tensor(tokenized_data)
# input_tensor = torch.squeeze(input_tensor)
try:
out = model(tokenized_data)
except Exception as e:
raise Exception("tensor shape is", input_tensor.shape, "exception was:", e)
# raise Exception("tensor shape is", input_tensor.shape, "exception was:", e)
raise Exception(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 5f14c49

Please sign in to comment.