Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'float' object is not subscriptable #9

Closed
epetros opened this issue Aug 23, 2020 · 2 comments
Closed

'float' object is not subscriptable #9

epetros opened this issue Aug 23, 2020 · 2 comments
Assignees

Comments

@epetros
Copy link

epetros commented Aug 23, 2020

Hello,
Following the demo at https://github.com/ohmeow/blurr/blob/master/nbs/02e_modeling-summarization.ipynb, I get the following error at dls = dblock.dataloaders(cnndm_df, bs=2) :

TypeError Traceback (most recent call last)
in ()
----> 1 dls = dblock.dataloaders(cnndm_df, bs=2)

18 frames
/usr/local/lib/python3.6/dist-packages/blurr/data/core.py in encodes(self, inp)
30 inps = [inp, None] if (isinstance(inp, str) or self.is_pretokenized) else inp
31
---> 32 res = self.hf_tokenizer(inps[0], inps[1],
33 max_length=self.max_length,
34 padding=self.padding,

TypeError: 'float' object is not subscriptable

@ohmeow ohmeow self-assigned this Aug 26, 2020
@ohmeow
Copy link
Owner

ohmeow commented Aug 28, 2020

What version of pytorch and fastai are you using?

@epetros
Copy link
Author

epetros commented Aug 29, 2020

Coercing dataframe values to string (str(...)) solved for me.

@epetros epetros closed this as completed Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants