Commit a8463d06 authored by seyonechithrananda's avatar seyonechithrananda
Browse files

yapf

parent 93181887
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@ from typing import Dict, List
try:
  from transformers import RobertaTokenizerFast
except ModuleNotFoundError:
  raise ImportError('Transformers must be installed for RobertaFeaturizer to be used!')
  raise ImportError(
      'Transformers must be installed for RobertaFeaturizer to be used!')
  pass


+31 −42
Original line number Diff line number Diff line
import pytest


@pytest.mark.torch
def setUp(self):
    from deepchem.feat.roberta_tokenizer import RobertaFeaturizer
    self.smiles = ["Cn1c(=O)c2c(ncn2C)n(C)c1=O", "CC(=O)N1CN(C(C)=O)C(O)C1O"]
    self.long_molecule_smiles = [
        "CCCCCCCCCCCCCCCCCCCC(=O)OCCCNC(=O)c1ccccc1SSc1ccccc1C(=O)NCCCOC(=O)CCCCCCCCCCCCCCCCCCC"
    ]
    self.featurizer = RobertaFeaturizer.from_pretrained(
        "seyonec/SMILES_tokenized_PubChem_shard00_160k")


@pytest.mark.torch
def test_smiles_call(self):
  """Test __call__ method for the featurizer, which is inherited from HuggingFace's RobertaTokenizerFast"""