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

fix regexes with escape sequence #17943

Merged
merged 1 commit into from
Jun 29, 2022
Merged

fix regexes with escape sequence #17943

merged 1 commit into from
Jun 29, 2022

Conversation

stas00
Copy link
Contributor

@stas00 stas00 commented Jun 29, 2022

This PR fixes:

src/transformers/dynamic_module_utils.py:81
  /workspace/transformers/src/transformers/dynamic_module_utils.py:81: DeprecationWarning: invalid escape sequence \s
    relative_imports = re.findall("^\s*import\s+\.(\S+)\s*$", content, flags=re.MULTILINE)
src/transformers/dynamic_module_utils.py:83
  /workspace/transformers/src/transformers/dynamic_module_utils.py:83: DeprecationWarning: invalid escape sequence \s
    relative_imports += re.findall("^\s*from\s+\.(\S+)\s+import", content, flags=re.MULTILINE)
src/transformers/dynamic_module_utils.py:125
  /workspace/transformers/src/transformers/dynamic_module_utils.py:125: DeprecationWarning: invalid escape sequence \s
    imports = re.findall("^\s*import\s+(\S+)\s*$", content, flags=re.MULTILINE)
src/transformers/dynamic_module_utils.py:127
  /workspace/transformers/src/transformers/dynamic_module_utils.py:127: DeprecationWarning: invalid escape sequence \s
    imports += re.findall("^\s*from\s+(\S+)\s+import", content, flags=re.MULTILINE)
src/transformers/modeling_utils.py:222
  /workspace/transformers/src/transformers/modeling_utils.py:222: DeprecationWarning: invalid escape sequence \d
    bit_search = re.search("[^\d](\d+)$", str(dtype))

@sgugger

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 29, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!

@stas00 stas00 merged commit 4c722e9 into main Jun 29, 2022
@stas00 stas00 deleted the invalid-escape-sequence branch June 29, 2022 15:55
viclzhu pushed a commit to viclzhu/transformers that referenced this pull request Jul 18, 2022
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