You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File :1006, in find_and_load_unlocked(name, import)
File :688, in _load_unlocked(spec)
File :883, in exec_module(self, module)
File :241, in _call_with_frames_removed(f, *args, **kwds)
File /opt/conda/lib/python3.10/site-packages/transformers/modeling_tf_utils.py:34
33 import numpy as np
---> 34 import tensorflow as tf
35 from packaging.version import parse
File /opt/conda/lib/python3.10/site-packages/tensorflow/init.py:45
43 _tf2.enable()
---> 45 from tensorflow._api.v2 import internal
46 from tensorflow._api.v2 import operators
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/init.py:11
10 from tensorflow._api.v2.internal import dispatch
---> 11 from tensorflow._api.v2.internal import distribute
12 from tensorflow._api.v2.internal import eager_context
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/distribute/init.py:8
6 import sys as _sys
----> 8 from tensorflow._api.v2.internal.distribute import combinations
9 from tensorflow._api.v2.internal.distribute import interim
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/distribute/combinations/init.py:8
6 import sys as _sys
----> 8 from tensorflow.python.distribute.combinations import env # line: 456
9 from tensorflow.python.distribute.combinations import generate # line: 365
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/combinations.py:33
32 from tensorflow.python.client import session
---> 33 from tensorflow.python.distribute import collective_all_reduce_strategy
34 from tensorflow.python.distribute import distribute_lib
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/collective_all_reduce_strategy.py:32
31 from tensorflow.python.distribute import input_util
---> 32 from tensorflow.python.distribute import mirrored_strategy
33 from tensorflow.python.distribute import multi_worker_util
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/mirrored_strategy.py:34
33 from tensorflow.python.distribute import values_util
---> 34 from tensorflow.python.distribute.cluster_resolver import tfconfig_cluster_resolver
35 from tensorflow.python.distribute.v1 import input_lib as input_lib_v1
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/cluster_resolver/init.py:27
26 from tensorflow.python.distribute.cluster_resolver.cluster_resolver import UnionClusterResolver
---> 27 from tensorflow.python.distribute.cluster_resolver.gce_cluster_resolver import GCEClusterResolver
28 from tensorflow.python.distribute.cluster_resolver.kubernetes_cluster_resolver import KubernetesClusterResolver
File /opt/conda/lib/python3.10/site-packages/googleapiclient/discovery.py:45
44 from google.auth.transport import mtls
---> 45 from google.oauth2 import service_account
47 # Third-party imports
File /opt/conda/lib/python3.10/site-packages/google/oauth2/service_account.py:77
76 from google.auth import _helpers
---> 77 from google.auth import _service_account_info
78 from google.auth import credentials
File /opt/conda/lib/python3.10/site-packages/google/auth/_service_account_info.py:20
18 import json
---> 20 from google.auth import crypt
21 from google.auth import exceptions
File /opt/conda/lib/python3.10/site-packages/google/auth/crypt/init.py:41
40 from google.auth.crypt import base
---> 41 from google.auth.crypt import rsa
43 try:
File :1006, in find_and_load_unlocked(name, import)
File :688, in _load_unlocked(spec)
File :883, in exec_module(self, module)
File :241, in _call_with_frames_removed(f, *args, **kwds)
File /opt/conda/lib/python3.10/site-packages/transformers/integrations/integration_utils.py:36
34 import packaging.version
---> 36 from .. import PreTrainedModel, TFPreTrainedModel
37 from .. import version as version
File :1075, in handle_fromlist(module, fromlist, import, recursive)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1754, in _LazyModule.getattr(self, name)
1753 elif name in self._class_to_module.keys():
-> 1754 module = self._get_module(self._class_to_module[name])
1755 value = getattr(module, name)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1766, in _LazyModule._get_module(self, module_name)
1765 except Exception as e:
-> 1766 raise RuntimeError(
1767 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its"
1768 f" traceback):\n{e}"
1769 ) from e
RuntimeError: Failed to import transformers.modeling_tf_utils because of the following error (look up to see its traceback):
module 'openssl' has no attribute 'ciphers'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Cell In[27], line 3
1 from langchain_huggingface import HuggingFaceEmbeddings
----> 3 embeddings=HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
File /opt/conda/lib/python3.10/site-packages/langchain_huggingface/embeddings/huggingface.py:53, in HuggingFaceEmbeddings.init(self, **kwargs)
51 super().init(**kwargs)
52 try:
---> 53 import sentence_transformers # type: ignore[import]
54 except ImportError as exc:
55 raise ImportError(
56 "Could not import sentence_transformers python package. "
57 "Please install it with pip install sentence-transformers."
58 ) from exc
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/init.py:10
7 import os
9 from sentence_transformers.backend import export_dynamic_quantized_onnx_model, export_optimized_onnx_model
---> 10 from sentence_transformers.cross_encoder.CrossEncoder import CrossEncoder
11 from sentence_transformers.datasets import ParallelSentencesDataset, SentencesDataset
12 from sentence_transformers.LoggingHandler import LoggingHandler
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/cross_encoder/init.py:3
1 from future import annotations
----> 3 from .CrossEncoder import CrossEncoder
5 all = ["CrossEncoder"]
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:20
18 from sentence_transformers.evaluation.SentenceEvaluator import SentenceEvaluator
19 from sentence_transformers.readers import InputExample
---> 20 from sentence_transformers.SentenceTransformer import SentenceTransformer
21 from sentence_transformers.util import fullname, get_device_name, import_from_string
23 logger = logging.getLogger(name)
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/SentenceTransformer.py:32
29 from transformers import is_torch_npu_available
30 from transformers.dynamic_module_utils import get_class_from_dynamic_module, get_relative_import_files
---> 32 from sentence_transformers.model_card import SentenceTransformerModelCardData, generate_model_card
33 from sentence_transformers.similarity_functions import SimilarityFunction
35 from . import MODEL_HUB_ORGANIZATION, version
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/model_card.py:25
23 from tqdm.autonotebook import tqdm
24 from transformers import TrainerCallback
---> 25 from transformers.integrations import CodeCarbonCallback
26 from transformers.modelcard import make_markdown_table
27 from transformers.trainer_callback import TrainerControl, TrainerState
File :1075, in handle_fromlist(module, fromlist, import, recursive)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1754, in _LazyModule.getattr(self, name)
1752 value = Placeholder
1753 elif name in self._class_to_module.keys():
-> 1754 module = self._get_module(self._class_to_module[name])
1755 value = getattr(module, name)
1756 else:
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1766, in _LazyModule._get_module(self, module_name)
1764 return importlib.import_module("." + module_name, self.name)
1765 except Exception as e:
-> 1766 raise RuntimeError(
1767 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its"
1768 f" traceback):\n{e}"
1769 ) from e
RuntimeError: Failed to import transformers.integrations.integration_utils because of the following error (look up to see its traceback):
Failed to import transformers.modeling_tf_utils because of the following error (look up to see its traceback):
module 'openssl' has no attribute 'ciphers'
Expected behavior
please fix this issue
The text was updated successfully, but these errors were encountered:
System Info
I was using
and I am getting an error as
Information
Tasks
Reproduction
AttributeError Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1764, in _LazyModule._get_module(self, module_name)
1763 try:
-> 1764 return importlib.import_module("." + module_name, self.name)
1765 except Exception as e:
File /opt/conda/lib/python3.10/importlib/init.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File :1050, in _gcd_import(name, package, level)
File :1027, in find_and_load(name, import)
File :1006, in find_and_load_unlocked(name, import)
File :688, in _load_unlocked(spec)
File :883, in exec_module(self, module)
File :241, in _call_with_frames_removed(f, *args, **kwds)
File /opt/conda/lib/python3.10/site-packages/transformers/modeling_tf_utils.py:34
33 import numpy as np
---> 34 import tensorflow as tf
35 from packaging.version import parse
File /opt/conda/lib/python3.10/site-packages/tensorflow/init.py:45
43 _tf2.enable()
---> 45 from tensorflow._api.v2 import internal
46 from tensorflow._api.v2 import operators
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/init.py:11
10 from tensorflow._api.v2.internal import dispatch
---> 11 from tensorflow._api.v2.internal import distribute
12 from tensorflow._api.v2.internal import eager_context
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/distribute/init.py:8
6 import sys as _sys
----> 8 from tensorflow._api.v2.internal.distribute import combinations
9 from tensorflow._api.v2.internal.distribute import interim
File /opt/conda/lib/python3.10/site-packages/tensorflow/_api/v2/internal/distribute/combinations/init.py:8
6 import sys as _sys
----> 8 from tensorflow.python.distribute.combinations import env # line: 456
9 from tensorflow.python.distribute.combinations import generate # line: 365
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/combinations.py:33
32 from tensorflow.python.client import session
---> 33 from tensorflow.python.distribute import collective_all_reduce_strategy
34 from tensorflow.python.distribute import distribute_lib
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/collective_all_reduce_strategy.py:32
31 from tensorflow.python.distribute import input_util
---> 32 from tensorflow.python.distribute import mirrored_strategy
33 from tensorflow.python.distribute import multi_worker_util
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/mirrored_strategy.py:34
33 from tensorflow.python.distribute import values_util
---> 34 from tensorflow.python.distribute.cluster_resolver import tfconfig_cluster_resolver
35 from tensorflow.python.distribute.v1 import input_lib as input_lib_v1
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/cluster_resolver/init.py:27
26 from tensorflow.python.distribute.cluster_resolver.cluster_resolver import UnionClusterResolver
---> 27 from tensorflow.python.distribute.cluster_resolver.gce_cluster_resolver import GCEClusterResolver
28 from tensorflow.python.distribute.cluster_resolver.kubernetes_cluster_resolver import KubernetesClusterResolver
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py:24
23 try:
---> 24 from googleapiclient import discovery # pylint: disable=g-import-not-at-top
25 from oauth2client.client import GoogleCredentials # pylint: disable=g-import-not-at-top
File /opt/conda/lib/python3.10/site-packages/googleapiclient/discovery.py:45
44 from google.auth.transport import mtls
---> 45 from google.oauth2 import service_account
47 # Third-party imports
File /opt/conda/lib/python3.10/site-packages/google/oauth2/service_account.py:77
76 from google.auth import _helpers
---> 77 from google.auth import _service_account_info
78 from google.auth import credentials
File /opt/conda/lib/python3.10/site-packages/google/auth/_service_account_info.py:20
18 import json
---> 20 from google.auth import crypt
21 from google.auth import exceptions
File /opt/conda/lib/python3.10/site-packages/google/auth/crypt/init.py:41
40 from google.auth.crypt import base
---> 41 from google.auth.crypt import rsa
43 try:
File /opt/conda/lib/python3.10/site-packages/google/auth/crypt/rsa.py:20
18 try:
19 # Prefer cryptograph-based RSA implementation.
---> 20 from google.auth.crypt import _cryptography_rsa
22 RSASigner = _cryptography_rsa.RSASigner
File /opt/conda/lib/python3.10/site-packages/google/auth/crypt/_cryptography_rsa.py:25
24 from cryptography.hazmat.primitives import hashes
---> 25 from cryptography.hazmat.primitives import serialization
26 from cryptography.hazmat.primitives.asymmetric import padding
File /opt/conda/lib/python3.10/site-packages/cryptography/hazmat/primitives/serialization/init.py:25
17 from cryptography.hazmat.primitives.serialization.base import (
18 load_der_parameters,
19 load_der_private_key,
(...)
23 load_pem_public_key,
24 )
---> 25 from cryptography.hazmat.primitives.serialization.ssh import (
26 SSHCertificate,
27 SSHCertificateBuilder,
28 SSHCertificateType,
29 SSHCertPrivateKeyTypes,
30 SSHCertPublicKeyTypes,
31 SSHPrivateKeyTypes,
32 SSHPublicKeyTypes,
33 load_ssh_private_key,
34 load_ssh_public_identity,
35 load_ssh_public_key,
36 )
38 all = [
39 "BestAvailableEncryption",
40 "Encoding",
(...)
62 "load_ssh_public_key",
63 ]
File /opt/conda/lib/python3.10/site-packages/cryptography/hazmat/primitives/serialization/ssh.py:27
26 from cryptography.hazmat.primitives.asymmetric import utils as asym_utils
---> 27 from cryptography.hazmat.primitives.ciphers import (
28 AEADDecryptionContext,
29 Cipher,
30 algorithms,
31 modes,
32 )
33 from cryptography.hazmat.primitives.serialization import (
34 Encoding,
35 KeySerializationEncryption,
(...)
39 _KeySerializationEncryption,
40 )
File /opt/conda/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/init.py:11
7 from cryptography.hazmat.primitives._cipheralgorithm import (
8 BlockCipherAlgorithm,
9 CipherAlgorithm,
10 )
---> 11 from cryptography.hazmat.primitives.ciphers.base import (
12 AEADCipherContext,
13 AEADDecryptionContext,
14 AEADEncryptionContext,
15 Cipher,
16 CipherContext,
17 )
19 all = [
20 "AEADCipherContext",
21 "AEADDecryptionContext",
(...)
26 "CipherContext",
27 ]
File /opt/conda/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/base.py:143
133 _CIPHER_TYPE = Cipher[
134 typing.Union[
135 modes.ModeWithNonce,
(...)
140 ]
141 ]
--> 143 CipherContext.register(rust_openssl.ciphers.CipherContext)
144 AEADEncryptionContext.register(rust_openssl.ciphers.AEADEncryptionContext)
AttributeError: module 'openssl' has no attribute 'ciphers'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1764, in _LazyModule._get_module(self, module_name)
1763 try:
-> 1764 return importlib.import_module("." + module_name, self.name)
1765 except Exception as e:
File /opt/conda/lib/python3.10/importlib/init.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File :1050, in _gcd_import(name, package, level)
File :1027, in find_and_load(name, import)
File :1006, in find_and_load_unlocked(name, import)
File :688, in _load_unlocked(spec)
File :883, in exec_module(self, module)
File :241, in _call_with_frames_removed(f, *args, **kwds)
File /opt/conda/lib/python3.10/site-packages/transformers/integrations/integration_utils.py:36
34 import packaging.version
---> 36 from .. import PreTrainedModel, TFPreTrainedModel
37 from .. import version as version
File :1075, in handle_fromlist(module, fromlist, import, recursive)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1754, in _LazyModule.getattr(self, name)
1753 elif name in self._class_to_module.keys():
-> 1754 module = self._get_module(self._class_to_module[name])
1755 value = getattr(module, name)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1766, in _LazyModule._get_module(self, module_name)
1765 except Exception as e:
-> 1766 raise RuntimeError(
1767 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its"
1768 f" traceback):\n{e}"
1769 ) from e
RuntimeError: Failed to import transformers.modeling_tf_utils because of the following error (look up to see its traceback):
module 'openssl' has no attribute 'ciphers'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Cell In[27], line 3
1 from langchain_huggingface import HuggingFaceEmbeddings
----> 3 embeddings=HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
File /opt/conda/lib/python3.10/site-packages/langchain_huggingface/embeddings/huggingface.py:53, in HuggingFaceEmbeddings.init(self, **kwargs)
51 super().init(**kwargs)
52 try:
---> 53 import sentence_transformers # type: ignore[import]
54 except ImportError as exc:
55 raise ImportError(
56 "Could not import sentence_transformers python package. "
57 "Please install it with
pip install sentence-transformers
."58 ) from exc
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/init.py:10
7 import os
9 from sentence_transformers.backend import export_dynamic_quantized_onnx_model, export_optimized_onnx_model
---> 10 from sentence_transformers.cross_encoder.CrossEncoder import CrossEncoder
11 from sentence_transformers.datasets import ParallelSentencesDataset, SentencesDataset
12 from sentence_transformers.LoggingHandler import LoggingHandler
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/cross_encoder/init.py:3
1 from future import annotations
----> 3 from .CrossEncoder import CrossEncoder
5 all = ["CrossEncoder"]
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:20
18 from sentence_transformers.evaluation.SentenceEvaluator import SentenceEvaluator
19 from sentence_transformers.readers import InputExample
---> 20 from sentence_transformers.SentenceTransformer import SentenceTransformer
21 from sentence_transformers.util import fullname, get_device_name, import_from_string
23 logger = logging.getLogger(name)
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/SentenceTransformer.py:32
29 from transformers import is_torch_npu_available
30 from transformers.dynamic_module_utils import get_class_from_dynamic_module, get_relative_import_files
---> 32 from sentence_transformers.model_card import SentenceTransformerModelCardData, generate_model_card
33 from sentence_transformers.similarity_functions import SimilarityFunction
35 from . import MODEL_HUB_ORGANIZATION, version
File /opt/conda/lib/python3.10/site-packages/sentence_transformers/model_card.py:25
23 from tqdm.autonotebook import tqdm
24 from transformers import TrainerCallback
---> 25 from transformers.integrations import CodeCarbonCallback
26 from transformers.modelcard import make_markdown_table
27 from transformers.trainer_callback import TrainerControl, TrainerState
File :1075, in handle_fromlist(module, fromlist, import, recursive)
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1754, in _LazyModule.getattr(self, name)
1752 value = Placeholder
1753 elif name in self._class_to_module.keys():
-> 1754 module = self._get_module(self._class_to_module[name])
1755 value = getattr(module, name)
1756 else:
File /opt/conda/lib/python3.10/site-packages/transformers/utils/import_utils.py:1766, in _LazyModule._get_module(self, module_name)
1764 return importlib.import_module("." + module_name, self.name)
1765 except Exception as e:
-> 1766 raise RuntimeError(
1767 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its"
1768 f" traceback):\n{e}"
1769 ) from e
RuntimeError: Failed to import transformers.integrations.integration_utils because of the following error (look up to see its traceback):
Failed to import transformers.modeling_tf_utils because of the following error (look up to see its traceback):
module 'openssl' has no attribute 'ciphers'
Expected behavior
please fix this issue
The text was updated successfully, but these errors were encountered: