Skip to content

Commit 5f7e529

Browse files
authored
ensure that torch is not used unless it is available (#467)
1 parent 6fdf8c0 commit 5f7e529

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spacy_llm/models/hf/stablelm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from confection import SimpleFrozenDict
44

5-
from ...compat import Literal, has_transformers, torch, transformers
5+
from ...compat import Literal, has_torch, has_transformers, torch, transformers
66
from ...registry.util import registry
77
from .base import HuggingFace
88

9-
if has_transformers:
9+
if has_transformers and has_torch:
1010

1111
class _StopOnTokens(transformers.StoppingCriteria):
1212
def __call__(

0 commit comments

Comments
 (0)