mirror of
https://github.com/Steffo99/unimore-bda-6.git
synced 2024-11-25 01:04:19 +00:00
Manually run garbage collection after each iteration
This commit is contained in:
parent
e93a8ddaf7
commit
c992c04264
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import pymongo.errors
|
import pymongo.errors
|
||||||
|
import gc
|
||||||
from .log import install_general_log_handlers
|
from .log import install_general_log_handlers
|
||||||
|
|
||||||
install_general_log_handlers()
|
install_general_log_handlers()
|
||||||
|
@ -59,6 +60,10 @@ def main():
|
||||||
HuggingBertTokenizer,
|
HuggingBertTokenizer,
|
||||||
]:
|
]:
|
||||||
|
|
||||||
|
log.debug("Running garbage collection...")
|
||||||
|
garbage_count = gc.collect()
|
||||||
|
log.debug("Collected %d pieces of garbage!", garbage_count)
|
||||||
|
|
||||||
slog = logging.getLogger(f"{__name__}.{sample_func.__name__}.{SentimentAnalyzer.__name__}.{Tokenizer.__name__}")
|
slog = logging.getLogger(f"{__name__}.{sample_func.__name__}.{SentimentAnalyzer.__name__}.{Tokenizer.__name__}")
|
||||||
slog.debug("Selected Tokenizer: %s", Tokenizer.__name__)
|
slog.debug("Selected Tokenizer: %s", Tokenizer.__name__)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue