bitsandbytes-foundation / bitsandbytes

Accessible large language models via k-bit quantization for PyTorch.
https://huggingface.co/docs/bitsandbytes/main/en/index
MIT License
6.33k stars 635 forks source link

Fix invalid escape sequence warning in Python 3.12 #1420

Closed oshiteku closed 6 days ago

oshiteku commented 6 days ago

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:

github-actions[bot] commented 6 days ago

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 commented 6 days ago

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