mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
12 lines
322 B
Python
12 lines
322 B
Python
![]() |
from typing import TYPE_CHECKING
|
||
|
|
||
|
from transformers.utils import (OptionalDependencyNotAvailable,
|
||
|
is_torch_available)
|
||
|
|
||
|
if TYPE_CHECKING:
|
||
|
try:
|
||
|
if not is_torch_available():
|
||
|
raise OptionalDependencyNotAvailable()
|
||
|
except OptionalDependencyNotAvailable:
|
||
|
pass
|