虽然OpenAI 检测器在识别由 ChatGPT 和其他基于 OpenAI 的模型创建的内容方面很有用,但随着使用量的增加(尤其是 Stack Exchange 网站上的用户),它的故障频率越来越高。
根据项目README在本地安装后,尝试使用以下命令从 repo 目录运行它时收到以下错误python -m detector.server ../gpt-2-models/detector-base.pt
:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/ntd/src/gpt-2-output-dataset/detector/server.py", line 120, in <module>
fire.Fire(main)
File "/home/ntd/src/venv/openai-detector/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/ntd/src/venv/openai-detector/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/ntd/src/venv/openai-detector/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/ntd/src/gpt-2-output-dataset/detector/server.py", line 89, in main
model.load_state_dict(data['model_state_dict'])
File "/home/ntd/src/venv/openai-detector/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1671, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification:
Missing key(s) in state_dict: "roberta.embeddings.position_ids".
Unexpected key(s) in state_dict: "roberta.pooler.dense.weight", "roberta.pooler.dense.bias".
我试图根据这个问题transformers==2.9.1
中的评论进行更改,但也失败了。pip install -r requirements.txt