Commit 8e149f38 authored by 赵小蒙's avatar 赵小蒙
Browse files

fix: The presence of ".pdf" multiple times in the pdf_path results in...

fix: The presence of ".pdf" multiple times in the pdf_path results in model_path not matching the expected.
parent 386b17ad
...@@ -290,7 +290,11 @@ def pdf_command(pdf, model, method, inside_model): ...@@ -290,7 +290,11 @@ def pdf_command(pdf, model, method, inside_model):
def get_model_json(model_path): def get_model_json(model_path):
# 这里处理pdf和模型相关的逻辑 # 这里处理pdf和模型相关的逻辑
if model_path is None: if model_path is None:
model_path = pdf.replace(".pdf", ".json") file_name_without_extension, extension = os.path.splitext(pdf)
if extension == ".pdf":
model_path = file_name_without_extension + ".json"
else:
raise Exception("pdf_path input error")
if not os.path.exists(model_path): if not os.path.exists(model_path):
logger.warning( logger.warning(
f"not found json {model_path} existed" f"not found json {model_path} existed"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment