From 5f7e5292d6495fbba4128f8468585ab61be68693 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Fri, 17 May 2024 10:35:39 +0200 Subject: [PATCH] ensure that torch is not used unless it is available (#467) --- spacy_llm/models/hf/stablelm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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__(