Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing this on ubi9 container it blows up when pulling in the library. #32

Closed
rhatdan opened this issue Jan 16, 2025 · 1 comment
Closed

Comments

@rhatdan
Copy link

rhatdan commented Jan 16, 2025

python3 /PRAGmatic/pragmatic/main.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1817, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/lib64/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/usr/local/lib/python3.9/site-packages/transformers/generation/streamers.py", line 231, in
class AsyncTextIteratorStreamer(TextStreamer):
File "/usr/local/lib/python3.9/site-packages/transformers/generation/streamers.py", line 285, in AsyncTextIteratorStreamer
self, tokenizer: "AutoTokenizer", skip_prompt: bool = False, timeout: float | None = None, **decode_kwargs
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/PRAGmatic/pragmatic/main.py", line 6, in
from api import index_path_for_rag, execute_rag_query, evaluate_rag_pipeline
File "/PRAGmatic/pragmatic/api.py", line 1, in
from pragmatic.pipelines.indexing import LocalFileIndexingPipelineWrapper
File "/usr/local/lib/python3.9/site-packages/pragmatic/init.py", line 1, in
from .api import *
File "/usr/local/lib/python3.9/site-packages/pragmatic/api.py", line 1, in
from pragmatic.pipelines.indexing import LocalFileIndexingPipelineWrapper
File "/usr/local/lib/python3.9/site-packages/pragmatic/pipelines/indexing.py", line 4, in
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
File "/usr/local/lib/python3.9/site-packages/haystack/components/embedders/init.py", line 7, in
from haystack.components.embedders.hugging_face_api_document_embedder import HuggingFaceAPIDocumentEmbedder
File "/usr/local/lib/python3.9/site-packages/haystack/components/embedders/hugging_face_api_document_embedder.py", line 14, in
from haystack.utils.hf import HFEmbeddingAPIType, HFModelType, check_valid_model
File "/usr/local/lib/python3.9/site-packages/haystack/utils/hf.py", line 312, in
from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast, StoppingCriteria, TextStreamer
File "", line 1055, in _handle_fromlist
File "/usr/local/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1806, in getattr
value = getattr(module, name)
File "/usr/local/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1805, in getattr
module = self._get_module(self._class_to_module[name])
File "/usr/local/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1819, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.generation.streamers because of the following error (look up to see its traceback):
unsupported operand type(s) for |: 'type' and 'NoneType'

@ilya-kolchinsky
Copy link
Collaborator

The failure is caused by a known bug in the HuggingFace Transformers library: huggingface/transformers#35639
This issue will be fixed with the next release of transformers (v4.49). In the meantime, the workaround is to use Python 3.10 or above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants