mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-04-05 07:28:36 +07:00
The clean_memory function has been removed from pdf_parse_union_core_v2.py due to it not being used. This change streamlines the code and prevents potential confusion regarding its purpose.
10 lines
211 B
Python
10 lines
211 B
Python
# Copyright (c) Opendatalab. All rights reserved.
|
|
import torch
|
|
import gc
|
|
|
|
|
|
def clean_memory():
|
|
if torch.cuda.is_available():
|
|
torch.cuda.empty_cache()
|
|
torch.cuda.ipc_collect()
|
|
gc.collect() |