Skip to content

Conversation

@oshiteku
Copy link
Contributor

When importing bitsandbytes for the first time in Python 3.12, the following warning is displayed:

$ python -c 'import bitsandbytes'
/home/oshiteku/tmp/.venv/lib/python3.12/site-packages/bitsandbytes/cextension.py:48: SyntaxWarning: invalid escape sequence '\d'
  library_name = re.sub("cuda\d+", f"cuda{override_value}", library_name, count=1)

Changes:

  • Fix invalid escape sequence in regex pattern
  • Add linter configuration to check for invalid escape sequences

@github-actions
Copy link

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@matthewdouglas
Copy link
Member

Thanks! I don't see the warning show up on my environment (Python 3.12.7, Arch Linux) but this change is sensible.

@matthewdouglas matthewdouglas added Bug Something isn't working Low Risk Risk of bugs in transformers and other libraries labels Nov 19, 2024
@matthewdouglas matthewdouglas merged commit 31eeb60 into bitsandbytes-foundation:main Nov 19, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Low Risk Risk of bugs in transformers and other libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants