Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions autopeptideml/reps/lms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
'MoLFormer-XL-both-10pct': 768,
'ChemBERTa-77M-MLM': 384,
'ChemBERTa-100M-MLM': 768,
'PeptideCLM-23M-all': 768
'PeptideCLM-23M-all': 768,
'PeptideMTR_lg': 1024,
}

SYNONYMS = {
Expand All @@ -55,7 +56,8 @@
'molformer-xl': 'MoLFormer-XL-both-10pct',
'chemberta-2': 'ChemBERTa-77M-MLM',
'chemberta-3': 'ChemBERTa-100M-MLM',
'peptideclm': 'PeptideCLM-23M-all'
'peptideclm': 'PeptideCLM-23M-all',
'peptidemtr': "PeptideMTR_lg",
}


Expand Down Expand Up @@ -198,10 +200,12 @@ def _load_model(self, model: str):
elif 'ankh' in model.lower():
self.lab = 'ElnaggarLab'
elif 'molformer' in model.lower():
print("Warning: Molformer does not support transformers>=5.0.0, we recommend using an earlier version, e.g., transformers==4.41.2")
self.lab = 'ibm'
elif 'chemberta' in model.lower():
self.lab = 'DeepChem'
elif 'clm' in model.lower():
elif (('clm' in model.lower() or 'mtr' in model.lower()) and
'peptide' in model.lower()):
self.lab = 'aaronfeller'
if 't5' in model.lower():
self.tokenizer = T5Tokenizer.from_pretrained(f'Rostlab/{model}',
Expand Down Expand Up @@ -309,7 +313,10 @@ def _rep_batch(
attention_mask=inputs['attention_mask'],
decoder_input_ids=inputs['input_ids']
).last_hidden_state
elif 'peptidemtr' in self.model_name.lower():
embd_rpr = self.model(**inputs)['last_layer']
else:
print(self.model(**inputs))
embd_rpr = self.model(**inputs).last_hidden_state
output = []
for idx in range(len(batch)):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ def get_files_in_dir(path: Path, base: Path) -> list:
name='autopeptideml',
packages=find_packages(exclude=['examples']),
url='https://ibm.github.io/AutoPeptideML/',
version='2.0.4',
version='2.0.5',
zip_safe=False,
)