Former-commit-id: cc275abe09665668289eb11efb446d1876318110
This commit is contained in:
hiyouga 2024-01-04 23:05:08 +08:00
parent 9a496950aa
commit dabd40750c

View File

@ -4,7 +4,6 @@ import torch
from typing import TYPE_CHECKING, Tuple
from transformers import InfNanRemoveLogitsProcessor, LogitsProcessorList
from transformers.utils import (
is_torch_bf16_cpu_available,
is_torch_bf16_gpu_available,
is_torch_cuda_available,
is_torch_npu_available,
@ -13,7 +12,7 @@ from transformers.utils import (
_is_fp16_available = is_torch_npu_available() or is_torch_cuda_available()
try:
_is_bf16_available = is_torch_bf16_gpu_available() or is_torch_bf16_cpu_available()
_is_bf16_available = is_torch_bf16_gpu_available()
except:
_is_bf16_available = False