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

Evaluation error #36

Open
nnmaitian opened this issue Mar 13, 2025 · 7 comments
Open

Evaluation error #36

nnmaitian opened this issue Mar 13, 2025 · 7 comments

Comments

@nnmaitian
Copy link

nnmaitian commented Mar 13, 2025

python ultrarag/evaluate/eval.py --pipeline_type vanilla --test_dataset /home/zz/Code/ultrarag/output/output.jsonl --selected_generated_metrics rouge --knowledge_id bf8c60dcb042558eb9cb128f57006f95 --knowledge_stat_tab_path resource/kb_manager/manage_table/knowledge_base_manager.csv --metric_api_key empty --metric_base_url http: --metric_model_name resource/models/MiniCPM3-4B --api_key empty --base_url http: --model_name resource/models/MiniCPM3-4B --embedding_model_path resource/models/minicpm-embedding-light --reranker_model_path resource/models/minicpm-reranker-light --pooling mean --topk 10 --embedding_gpu cuda:3 --reranker_gpu cuda:3 --output_path output/evaluate/vanilla-2025-03-12-11-07-26 --current_kb_config_id 154852c1d318c14bbce6af7734a73338

output.jsonl:仅为一个问题
{"instruction": "请回答下列问题,首先给出回答,然后给出对应的法律依据: 下面是一个例子:\n你好,律师,我想商量一下,昨天我和托管公司签了租赁合同,合同的甲方只有公章,没有人签字,这样的合同正式吗?\n回答:租赁合同甲方可以两个人签字,应符合法律规定。法律依据:《合同法》第四十四条规定,依法成立的合同,自成立时生效。法律、行政法规规定应当办理批准、登记等手续生效的,依照其规定\n请你回答:", "question": "介绍BasicSR?", "answer": "回答:BasicSR 是一个开源项目,旨在提供一个方便易用的图像、视频的超分、复原、增强的工具箱。从2018年4月20日开始,功能从最开始的针对超分辨率算法到后来拓展到其他更多复原增强相关的算法,因此,BasicSR 中 SR 的涵义也从 Super-Resolution 延拓到 Super-Restoration。"}

错误如下:
2025-03-13 14:41:44.644 | ERROR | main:process_datasets:151 - Traceback (most recent call last):
File "/home/zz/Code/ultrarag/ultrarag/evaluate/eval.py", line 141, in process_datasets
async for chunk in predictions:
File "/home/zz/Code/ultrarag/ultrarag/workflow/ultraragflow/simple_flow.py", line 103, in naive_rag
recalls = await self._index.search(query=query, topn=25)
File "/home/zz/Code/ultrarag/ultrarag/modules/database/qdrant.py", line 169, in search
query_embedding = await self.encoder.query_encode(query)
File "/home/zz/Code/ultrarag/ultrarag/modules/embedding/minicpm_embedding.py", line 404, in query_encode
queries = [f"{self.query_instruction} {query}" for query in queries]
TypeError: 'NoneType' object is not iterable

@Kaguya-19
Copy link
Collaborator

请将您的"question"key改为"query"

@nnmaitian
Copy link
Author

nnmaitian commented Mar 13, 2025

您好,换了一个新的问题,是我哪里没有设对吗?
2025-03-13 15:41:30.270 | ERROR | main:process_datasets:151 - Traceback (most recent call last):
File "/home/zz/Code/ultrarag/ultrarag/evaluate/eval.py", line 141, in process_datasets
async for chunk in predictions:
File "/home/zz/Code/ultrarag/ultrarag/workflow/ultraragflow/simple_flow.py", line 119, in naive_rag
async for item in format_view(response):
File "/home/zz/Code/ultrarag/ultrarag/common/utils.py", line 291, in format_view
async for item in response:
File "/home/zz/Code/ultrarag/ultrarag/modules/llm/openai_like.py", line 34, in chat_generator
response = await self._generator_async.chat.completions.create(
File "/home/zz/mambaforge/envs/ultrarag/lib/python3.10/site-packages/openai/resources/chat/completions/completions.py", line 2000, in create
return await self._post(
File "/home/zz/mambaforge/envs/ultrarag/lib/python3.10/site-packages/openai/_base_client.py", line 1767, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/home/zz/mambaforge/envs/ultrarag/lib/python3.10/site-packages/openai/_base_client.py", line 1461, in request
return await self._request(
File "/home/zz/mambaforge/envs/ultrarag/lib/python3.10/site-packages/openai/_base_client.py", line 1562, in _request
raise self._make_status_error_from_response(err.response) from None
openai.PermissionDeniedError: <title>403: Forbidden</title>403: Forbidden

@nnmaitian
Copy link
Author

我调用的不是本地模型吗,为什么会跑去调用openai

@Kaguya-19
Copy link
Collaborator

啊我们这里写的可能不太清楚,model_name是调用openai时的model_name如gpt4o,调用本地模型的参数名为model_name_or_path 非常感谢您的反馈,我们会尽早修补这个问题

@nnmaitian
Copy link
Author

nnmaitian commented Mar 13, 2025

以及请教一下如果我想把评测系统RAGAS(https://docs.ragas.io/en/latest/
引入作为新的评测指标,代码的改动思路,要改的文件等

@gdw439
Copy link
Collaborator

gdw439 commented Mar 17, 2025

目前 UltraRAG 对RAGAS 没有适配,或许您可以尝试导出 UltraRAG 评测的结果,转换成RAGAS支持的输入评测协议

@nnmaitian
Copy link
Author

Image

Image

你好请教一下corpus_toy.jsonl文件中间的,id是怎么来的,我看这个ID的长度与UI界面中间的file list里面的ID长度还不太一致

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

3 participants