Commit 1ada4bd9 authored by seyonechithrananda's avatar seyonechithrananda
Browse files

use warning instead of error

parent c0725899
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -73,6 +73,14 @@ try:
except ModuleNotFoundError:
  pass

try:
  from transformers import RobertaTokenizerFast
except ModuleNotFoundError:
  # raise ImportError('This class requires transformers.')
  raise ImportWarning(
      'This class requires transformers. Please use "pip install transformers" to continue.'
  )
  pass
from deepchem.feat.roberta_tokenizer import RobertaFeaturizer

# support classes
+0 −1
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ class RobertaFeaturizer(RobertaTokenizerFast, Featurizer):
    """

    # the encoding is natively a dictionary with keys 'input_ids' and 'attention_mask'
    # -> make this a list of two lists to allow np to handle it
    # encoding = list(self(smiles_string, **kwargs).values())
    encoding = list(self(sequence, **kwargs).values())
    return encoding