Fix JSON parsing error
This commit is contained in:
@@ -12,7 +12,11 @@ if not os.path.exists(WORKING_DIR):
|
||||
|
||||
|
||||
async def lmdeploy_model_complete(
|
||||
prompt=None, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs
|
||||
prompt=None,
|
||||
system_prompt=None,
|
||||
history_messages=[],
|
||||
keyword_extraction=False,
|
||||
**kwargs,
|
||||
) -> str:
|
||||
model_name = kwargs["hashing_kv"].global_config["llm_model_name"]
|
||||
return await lmdeploy_model_if_cache(
|
||||
|
@@ -479,7 +479,7 @@ async def kg_query(
|
||||
print(result)
|
||||
try:
|
||||
# json_text = locate_json_string_body_from_string(result) # handled in use_model_func
|
||||
result = re.search(r"{.*}", json_text, re.DOTALL)
|
||||
result = re.search(r"{.*}", result, re.DOTALL)
|
||||
keywords_data = json.loads(result)
|
||||
hl_keywords = keywords_data.get("high_level_keywords", [])
|
||||
ll_keywords = keywords_data.get("low_level_keywords", [])
|
||||
|
Reference in New Issue
Block a user