Skip to content

Commit 8724c99

Browse files
committed
allow hiding of the welcome message
1 parent 4844aef commit 8724c99

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

bitsandbytes/cuda_setup/main.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"""
1818

1919
import ctypes
20+
import os
2021

2122
from .paths import determine_cuda_runtime_lib_path
2223
from bitsandbytes.cextension import CUDASetup
@@ -107,15 +108,17 @@ def get_compute_capability(cuda):
107108

108109

109110
def evaluate_cuda_setup():
110-
# we remove this for now and see how things go
111-
#print('')
112-
#print('='*35 + 'BUG REPORT' + '='*35)
113-
#print('Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues')
114-
#print('For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link')
115-
#print('='*80)
116-
#if not torch.cuda.is_available():
117-
#print('No GPU detected. Loading CPU library...')
118-
#return binary_name
111+
if 'BITSANDBYTES_NOWELCOME' not in os.environ or str(os.environ['BITSANDBYTES_NOWELCOME']) == '0':
112+
print('')
113+
print('=' * 35 + 'BUG REPORT' + '=' * 35)
114+
print('Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues')
115+
print('For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link')
116+
print('To hide this message, set the BITSANDBYTES_NOWELCOME variable like so: export BITSANDBYTES_NOWELCOME=1')
117+
print('=' * 80)
118+
119+
# if not torch.cuda.is_available():
120+
# print('No GPU detected. Loading CPU library...')
121+
# return binary_name
119122

120123
binary_name = "libbitsandbytes_cpu.so"
121124

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: 8-bit
22
channels:
33
- conda-forge
4+
- pytorch
45
dependencies:
56
- python=3.9
67
- pytest

0 commit comments

Comments
 (0)