-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Bug]: <title>Error generating community report.TypeError: Object of type ModelMetaclass is not JSON serializable #1715
Comments
解决了吗,我也遇见同样的问题了 |
还没修好,但是我发现是模型返回的社区总结中带了markdown的格式导致没办法识别成json,现在我怎么改提示词都没办法让模型输出不带markdown格式的回答,在考虑往源码里面加入格式处理的环节 |
嗯,你可以尝试换一个别的模型,我换成了阿里的qwen-max,就没有这个问题了 |
Same for me. |
ds-v3模型有这个问题,你可以去改代码:
|
感谢回答,确实是deepseek模型的问题,不过我前几天试着改了改提示词,最后改好了,返回的不再是markdown了。 |
请问你是怎么改的,目前我使用ds-V3也遇到了这个问题 |
我修改了community_report_graph.txt提示词中Report Structure部分的一句话,即json示例的前面的那句话,我改为了: |
非常感谢,修改提词之后可以正常解析了。 不过在1.2.0版本中,./graphrag/graphrag/prompts/index/community_report.py 没有找到“对返回的json需要可以直接被json.load()加载” 相关的要求。再次感谢 |
Do you need to file an issue?
Describe the bug
当我运行index的时候,出现了以下主要错误:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
fnllm.base.services.errors.FailedToGenerateValidJsonError: JSON response is not a valid JSON
fnllm.base.services.errors.FailedToGenerateValidJsonError
TypeError: Object of type ModelMetaclass is not JSON serializable.
When I run the index in generating the community report, always can appear error, including mentioned
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
fnllm.base.services.errors.FailedToGenerateValidJsonError: JSON response is not a valid JSON
fnllm.base.services.errors.FailedToGenerateValidJsonError
TypeError: Object of type ModelMetaclass is not JSON serializable.
有一段错误信息提到返回的json内容,如下:
There is an error message that mentions the returned json content as follows:
fnllm.base.services.errors.FailedToGenerateValidJsonError: JSON response is not a valid JSON, response=```json
{
"title": "Ahvaz Academic Community",
"summary": "The community centers around Ahvaz, a prominent city in Iran known for its academic institutions, including Ahvaz Jundishapur University of Medical Sciences and Shahid Chamran University. These institutions are linked to the city and to researchers like Seyyed Maysam Mousavi Shoar, who is affiliated with Shahid Chamran University. The community highlights Ahvaz's role as an educational hub in Iran.",
"rating": 4.5,
"rating_explanation": "The impact severity rating is moderate due to the community's influence in Iran's higher education landscape and its potential to shape academic and research outcomes.",
"findings": [
{
"summary": "Ahvaz as an educational hub",
"explanation": "Ahvaz is a key city in Iran, known for hosting significant academic institutions such as Ahvaz Jundishapur University of Medical Sciences and Shahid Chamran University. These institutions contribute to the city's reputation as a center for higher education and research. The presence of these universities underscores Ahvaz's importance in Iran's academic landscape and its potential to influence educational and research outcomes. [Data: Entities (706)]"
},
{
"summary": "Ahvaz Jundishapur University of Medical Sciences",
"explanation": "Ahvaz Jundishapur University of Medical Sciences is a prominent institution located in Ahvaz, focusing on medical education and research. Its presence in the city highlights Ahvaz's role in advancing medical knowledge and training healthcare professionals. The university's activities could have significant implications for public health and medical research in Iran. [Data: Relationships (845)]"
},
{
"summary": "Shahid Chamran University's academic contributions",
"explanation": "Shahid Chamran University is another key academic institution in Ahvaz, offering a broad range of academic disciplines. Its affiliation with researchers like Seyyed Maysam Mousavi Shoar demonstrates its role in fostering academic and scientific research. The university's contributions to various fields of study could have a lasting impact on Iran's academic and research communities. [Data: Entities (802), Relationships (937)]"
},
{
"summary": "Seyyed Maysam Mousavi Shoar's research affiliation",
"explanation": "Seyyed Maysam Mousavi Shoar is a researcher affiliated with Shahid Chamran University, focusing on basic sciences. His work contributes to the university's academic output and highlights the institution's commitment to advancing scientific knowledge. Researchers like Shoar play a crucial role in shaping the academic and research landscape in Ahvaz and beyond. [Data: Entities (807), Relationships (937)]"
}
]
}
Logs and screenshots
Additional Information
The text was updated successfully, but these errors were encountered: