docs: Minor fixes to demo code on README

#1

Minor fixes to API calls were made to accomodate bugs that occured during runtiem of demo code on the README.

ERROR logs :

Image() cannot be called as it's a module, what the author was referring to is Image.open() method.

Also the following traceback indicates that offset mappings should not be sent forward by the encoders.
# TypeError                                 Traceback (most recent call last)
# <ipython-input-6-16306e8091eb> in <module>
#       1 with torch.no_grad():
# ----> 2   outputs = model(**encoding)
#       3   logits = outputs.logits
#       4 
#       5 predictions = logits.argmax(-1).squeeze().tolist()

# ~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
#    1188         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
#    1189                 or _global_forward_hooks or _global_forward_pre_hooks):
# -> 1190             return forward_call(*input, **kwargs)
#    1191         # Do not call functions when jit is used
#    1192         full_backward_hooks, non_full_backward_hooks = [], []

# TypeError: forward() got an unexpected keyword argument 'offset_mapping'

Thanks!

nielsr changed pull request status to merged

Sign up or log in to comment