Instructions to use SaeedLab/TITAN-BBB with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SaeedLab/TITAN-BBB with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SaeedLab/TITAN-BBB", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
4fee7bd
1
Parent(s): 72fa1d9
update
Browse files- classification/tokenizer_bbb.py +1 -0
- regression/tokenizer_bbb.py +1 -0
- tokenizer_bbb.py +1 -0
classification/tokenizer_bbb.py
CHANGED
|
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
|
|
|
| 58 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 59 |
|
| 60 |
def generate_img_features(self, smiles):
|
|
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
| 58 |
+
tab_input = np.clip(tab_input, -1e3, 1e3)
|
| 59 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 60 |
|
| 61 |
def generate_img_features(self, smiles):
|
regression/tokenizer_bbb.py
CHANGED
|
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
|
|
|
| 58 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 59 |
|
| 60 |
def generate_img_features(self, smiles):
|
|
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
| 58 |
+
tab_input = np.clip(tab_input, -1e3, 1e3)
|
| 59 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 60 |
|
| 61 |
def generate_img_features(self, smiles):
|
tokenizer_bbb.py
CHANGED
|
@@ -55,6 +55,7 @@ class BBBTokenizer(PreTrainedTokenizer):
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
|
|
|
| 58 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 59 |
|
| 60 |
def generate_img_features(self, smiles):
|
|
|
|
| 55 |
maccs = np.array(list(MACCSkeys.GenMACCSKeys(mol).ToBitString()), dtype=int)
|
| 56 |
tab_input = np.concatenate([rdkit_2d, maccs])
|
| 57 |
tab_input = self.feature_transformer_tab.transform(tab_input.reshape(1, -1))[0]
|
| 58 |
+
tab_input = np.clip(tab_input, -1e3, 1e3)
|
| 59 |
return torch.tensor(tab_input, dtype=torch.float32)
|
| 60 |
|
| 61 |
def generate_img_features(self, smiles):
|