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

Usage examples (pypi and readme) are outdated [BPETokenizer rename] #152

Closed
tsteffek opened this issue Feb 15, 2020 · 3 comments · Fixed by #155
Closed

Usage examples (pypi and readme) are outdated [BPETokenizer rename] #152

tsteffek opened this issue Feb 15, 2020 · 3 comments · Fixed by #155

Comments

@tsteffek
Copy link

tsteffek commented Feb 15, 2020

Edit: BPETokenizer has been renamed to CharBPETokenizer, however, all the examples still feature the BPETokenizer.

Original:
I just tried using the pypi package and it didn't work.

I opened a new virtual environment, installed tokenizers versions 0.4.2, 0.4.1, 0.4.0 and 0.3.0, started a Python console (using PyCharm, to be exact) and typed: from tokenizers import BPETokenizer.
For all these versions it would tell me:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: cannot import name 'BPETokenizer' from 'tokenizers' (C:\tools\miniconda3\envs\tokenizer\lib\site-packages\tokenizers\__init__.py)

Tokenizers 0.2.1 works fine.


My machine:

  • Win10 x64 Version 10.0.18363 Build 18363
  • Python 3.7.6
  • miniconda 4.8.0
  • pip 20.0.2
@amoux
Copy link

amoux commented Feb 16, 2020

I got the same issue in the latest version. But after installing version 0.2.1 I had no errors importing.

  • Ubuntu 19.10
  • Python 3.7 Anaconda
(python-37) user@user:~$ ipython
Python 3.7.6 | packaged by conda-forge | (default, Jan  7 2020, 22:33:48) 
In [1]: from tokenizers import BPETokenizer                                                             
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-812973393cae> in <module>
----> 1 from tokenizers import BPETokenizer
ImportError: cannot import name 'BPETokenizer' from 'tokenizers' (/home/user/anaconda3/envs/python-37/lib/python3.7/site-packages/tokenizers/__init__.py)

@aditya-malte
Copy link

Facing the same issue

@tsteffek
Copy link
Author

Ok, just looked at the changelogs, v0.3.0 did:

  • BPETokenizer has been renamed to CharBPETokenizer for clarity.

So, obviously importing BPETokenizer doesn't work. I'll change the name of the issue then...

@tsteffek tsteffek changed the title Pip package V0.3.0 and up not working Usage examples (pypi and readme) are outdated Feb 16, 2020
@tsteffek tsteffek changed the title Usage examples (pypi and readme) are outdated Usage examples (pypi and readme) are outdated [BPETokenizer rename] Feb 16, 2020
@n1t0 n1t0 closed this as completed in #155 Feb 18, 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

Successfully merging a pull request may close this issue.

3 participants