diff --git a/spacy_llm/models/hf/stablelm.py b/spacy_llm/models/hf/stablelm.py index 5b0d29b7..27456ee7 100644 --- a/spacy_llm/models/hf/stablelm.py +++ b/spacy_llm/models/hf/stablelm.py @@ -2,11 +2,11 @@ from confection import SimpleFrozenDict -from ...compat import Literal, has_transformers, torch, transformers +from ...compat import Literal, has_torch, has_transformers, torch, transformers from ...registry.util import registry from .base import HuggingFace -if has_transformers: +if has_transformers and has_torch: class _StopOnTokens(transformers.StoppingCriteria): def __call__(