mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-28 23:48:53 +00:00
chore: Fix lazy import in HuggingFaceLocalGenerator (#6752)
* Fix lazy import in HuggingFaceLocalGenerator * Fix pylint * Import fix after merge
This commit is contained in:
parent
7376838922
commit
88191e74bf
@ -2,7 +2,7 @@ import logging
|
||||
from typing import Any, Dict, List, Literal, Optional, Union
|
||||
|
||||
from haystack import component, default_from_dict, default_to_dict
|
||||
from haystack.components.generators.hf_utils import StopWordsCriteria
|
||||
|
||||
from haystack.lazy_imports import LazyImport
|
||||
from haystack.utils import ComponentDevice
|
||||
|
||||
@ -14,6 +14,7 @@ with LazyImport(message="Run 'pip install transformers[torch]'") as torch_and_tr
|
||||
import torch
|
||||
from huggingface_hub import model_info
|
||||
from transformers import StoppingCriteriaList, pipeline
|
||||
from haystack.components.generators.hf_utils import StopWordsCriteria # pylint: disable=ungrouped-imports
|
||||
|
||||
|
||||
@component
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user