Closed galen1980guo closed 3 months ago
Has anyone encountered the same issue, or does anyone know how to solve this problem? Thanks.
This is likely resolved with https://github.com/microsoft/graphrag/pull/801. We will push a release shortly, or you can update on main if you are running the codebase directly. Otherwise, there is lots of commentary linked to #657 about the JSON formats of non-OpenAI models
This is likely resolved with #801. We will push a release shortly, or you can update on main if you are running the codebase directly. Otherwise, there is lots of commentary linked to #657 about the JSON formats of non-OpenAI models
although json_clean_up repair json faulty responses,it increase index time and global search time 70-80% v0.2.0 index time 35min , v0.2.1 62min v0.2.0 global search time 45s , v0.2.1 75s
import re
def extract_json(input: str) -> str:
"""
Extract JSON content from a string, where JSON is embedded between ```json and ``` markers.
"""
text = input
# Define a regular expression pattern to match JSON blocks
pattern = r"```(.*?)```"
# Find all non-overlapping matches of the pattern in the string
matches = re.findall(pattern, text, re.DOTALL)
if not matches:
return input
# Return the matched JSON string, stripped of any leading or trailing whitespace
try:
return matches[0].strip()
except Exception:
raise ValueError(f"Failed to parse: {input}")
======= 用以上函数处理一下你的llm输出。 Use above function to process your LLM output.
We have resolved several issues related to text encoding and JSON parsing that are rolled up into version 0.2.2. Please try again with that version and re-open if this is still an issue.
extract_json
请问这个是修改哪个文件
Is there an existing issue for this?
Describe the issue
When I deployed the LLM using Ollama and the embeddings using Xinference, the process of building the index failed at the step create_final_community_reports. According to the detailed logs, it seems that the issue occurred due to a failure in parsing JSON.
Steps to reproduce
No response
GraphRAG Config Used
Logs and screenshots