FutureWarning close
how to close the messageEMBEDDING_MODEL_NAME = "hkunlp/instructor-large"
HuggingFaceEmbeddings(
            model_name=EMBEDDING_MODEL_NAME,
            model_kwargs={"device": device_type},
        )conda\envs\lang\Lib\site-packages\sentence_transformers\models\Dense.py:63: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  model.load_state_dict(torch.load(os.path.join(input_path, 'pytorch_model.bin'), map_location=torch.device('cpu')))
2024-08-27 16:07:29,795 - INFO - ingest.py:168 - Loaded embeddings from hkunlp/instructor-large
2024-08-27T08:51:37Z
You can set "weights_only = True "
2024-08-27T08:57:33Z
Ayon0611:weights_only = TrueThe same warning problem with thisHuggingFaceEmbeddings(
            model_name=EMBEDDING_MODEL_NAME,
            model_kwargs={"device": device_type, "weights_only": True},
        )
2024-08-27T11:34:23Z
hi@alice86transformers.utils.logging.set_verbosity_error() didn’t work for me, because warning doesn’t come from logging. But this one helps:stackoverflow.comHow to suppress Pandas Future warning?python, pandas, warnings, suppress-warningsasked bybigbugon02:37AM - 03 Apr 13 UTCAdding the following will filter outFutureWarning.import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)I tested it forUserWarning.
2024-08-28T02:43:08Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.