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

add __init__.py to utils #6754

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Conversation

joeddav
Copy link
Contributor

@joeddav joeddav commented Aug 26, 2020

Adds __init__.py to the utils dir introduced in #6434, which caused a namespace issues breaking imports in some cases. Mentioned in #6752.

To reproduce, pip install from source without the editable -e flag.

>>> from transformers import pipeline
...
~/.virtualenvs/transformers/lib/python3.7/site-packages/transformers/file_utils.py in <module>
---> 32 from .utils import logging
ModuleNotFoundError: No module named 'transformers.utils'

@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #6754 into master will increase coverage by 0.42%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6754      +/-   ##
==========================================
+ Coverage   79.02%   79.45%   +0.42%     
==========================================
  Files         157      157              
  Lines       28479    28479              
==========================================
+ Hits        22505    22627     +122     
+ Misses       5974     5852     -122     
Impacted Files Coverage Δ
src/transformers/tokenization_mbart.py 56.25% <0.00%> (-39.07%) ⬇️
src/transformers/tokenization_xlnet.py 66.66% <0.00%> (-23.43%) ⬇️
src/transformers/tokenization_dpr.py 57.65% <0.00%> (+4.50%) ⬆️
src/transformers/tokenization_xlm.py 82.93% <0.00%> (+66.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99407f9...c6e6400. Read the comment docs.

Copy link
Member

@thomwolf thomwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

@abelriboulot
Copy link
Contributor

This is great! I can confirm this fixes it. It would be good to merge it fast as the current master fails.

@thomwolf thomwolf merged commit 10a3450 into huggingface:master Aug 26, 2020
@sshleifer sshleifer mentioned this pull request Aug 27, 2020
3 tasks
@joeddav joeddav deleted the add-utils-init branch August 28, 2020 14:57
Zigur pushed a commit to Zigur/transformers that referenced this pull request Oct 26, 2020
fabiocapsouza pushed a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
fabiocapsouza added a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 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 this pull request may close these issues.

3 participants