Minor style changes

This commit is contained in:
oobabooga 2024-01-01 16:00:22 -08:00
parent cbf6f9e695
commit 94afa0f9cf

View File

@ -126,7 +126,6 @@ def load_tokenizer(model_name, model):
def huggingface_loader(model_name): def huggingface_loader(model_name):
path_to_model = Path(f'{shared.args.model_dir}/{model_name}') path_to_model = Path(f'{shared.args.model_dir}/{model_name}')
params = { params = {
'low_cpu_mem_usage': True, 'low_cpu_mem_usage': True,
@ -170,10 +169,8 @@ def huggingface_loader(model_name):
# Load with quantization and/or offloading # Load with quantization and/or offloading
else: else:
if not any((shared.args.cpu, torch.cuda.is_available(), is_xpu_available(), torch.backends.mps.is_available())): if not any((shared.args.cpu, torch.cuda.is_available(), is_xpu_available(), torch.backends.mps.is_available())):
logger.warning('torch.cuda.is_available() and is_xpu_available() returned False. This means that no GPU has been detected. Falling back to CPU mode.') logger.warning('torch.cuda.is_available() and is_xpu_available() returned False. This means that no GPU has been detected. Falling back to CPU mode.')
shared.args.cpu = True shared.args.cpu = True
if shared.args.cpu: if shared.args.cpu: