Skip to content

[Issue] 进行 evaluation 第四步时出现 pytorch 相关的安全性错误 #8

@Rhapsody0x1

Description

@Rhapsody0x1

作者您好!您的项目非常有趣,感谢您上传完整的代码!

我在尝试根据 evaluation 下的 README.md 测试您的项目,但运行到第四步 Evaluate the Generation 时出现了如下错误:

Traceback (most recent call last):
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/evaluation/get_score.py", line 4, in <module>
    from eval_r import cal_rsim
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/evaluation/eval_r.py", line 6, in <module>
    model = SimCSE("princeton-nlp/sup-simcse-roberta-large")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/evaluation/simcse/tool.py", line 28, in __init__
    self.model = AutoModel.from_pretrained(model_name_or_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/models/auto/auto_factory.py", line 604, in from_pretrained
    return model_class.from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/modeling_utils.py", line 288, in _wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/modeling_utils.py", line 5179, in from_pretrained
    ) = cls._load_pretrained_model(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/modeling_utils.py", line 5445, in _load_pretrained_model
    load_state_dict(checkpoint_files[0], map_location="meta", weights_only=weights_only).keys()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/modeling_utils.py", line 532, in load_state_dict
    check_torch_load_is_safe()
  File "/Users/****/Programming/RAGProjects/HyperGraphRAG/.venv/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1632, in check_torch_load_is_safe
    raise ValueError(
ValueError: Due to a serious vulnerability issue in `torch.load`, even with `weights_only=True`, we now require users to upgrade torch to at least v2.6 in order to use the function. This version restriction does not apply when loading files with safetensors.
See the vulnerability report here https://nvd.nist.gov/vuln/detail/CVE-2025-32434

请问作者是否会考虑更新 requiremnts.txt 中的 torch 版本?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions