Skip to content

Commit

Permalink
scvi template code
Browse files Browse the repository at this point in the history
  • Loading branch information
amva13 committed Jan 22, 2025
1 parent 596da8b commit e6ac188
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tdc/model_server/model_loaders/scvi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

class scVILoader:

def __init__(self):
pass

def load(self):
"""load scVI model
calling download_scvi() and any other helper functions
"""
20 changes: 20 additions & 0 deletions tdc/model_server/models/scvi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

class scVI:
"""class to load and perform inference w/ scvi
adding any additional utils from scvi that facilitate inference / data processing
"""

def __init__(self):
import scvi
pass

def forward(self, **kwargs):
"""
loads self.model if needed
calls inference on these arguments
"""

def load(self):
"""import the model loader
-> then, LOAD the MODEL CLASS and return it and also save it into self.model"""
5 changes: 4 additions & 1 deletion tdc/model_server/tdc_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'CYP3A4_Veith-AttentiveFP',
]

model_hub = ["Geneformer", "scGPT"]
model_hub = ["Geneformer", "scGPT", "scVI"]


class tdc_hf_interface:
Expand Down Expand Up @@ -66,6 +66,9 @@ def load(self):
AutoModel.register(ScGPTConfig, ScGPTModel)
model = AutoModel.from_pretrained("tdc/scGPT")
return model
elif self.model_name == "scVI":
# import scVI model and return the model class
pass
raise Exception("Not implemented yet!")

def load_deeppurpose(self, save_path):
Expand Down

0 comments on commit e6ac188

Please sign in to comment.