"lightx2v/vscode:/vscode.git/clone" did not exist on "4a9f0df5e60b7ecdd5a65ce1958d87f88dfbef09"
Commit 12b64a0e authored by myhloli's avatar myhloli
Browse files

fix: conditionally clean memory based on environment variable

parent d39aa87e
# Copyright (c) Opendatalab. All rights reserved.
import os
import time
from loguru import logger
......@@ -235,6 +236,7 @@ def result_to_middle_json(model_list, images_list, pdf_doc, image_writer, lang=N
"""清理内存"""
pdf_doc.close()
if os.getenv('MINERU_DONOT_CLEAN_MEM') is None:
clean_memory(get_device())
return middle_json
......
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