pszemraj commited on
Commit
565eabb
1 Parent(s): 55d0615

add forced gc after predict

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -5,6 +5,7 @@ Usage:
5
  python app.py
6
  """
7
  import contextlib
 
8
  import logging
9
  import os
10
  import random
@@ -72,6 +73,11 @@ def predict(
72
  batch_length=token_batch_length,
73
  **settings,
74
  )
 
 
 
 
 
75
  return summaries
76
 
77
 
 
5
  python app.py
6
  """
7
  import contextlib
8
+ import gc
9
  import logging
10
  import os
11
  import random
 
73
  batch_length=token_batch_length,
74
  **settings,
75
  )
76
+
77
+ del model
78
+ del tokenizer
79
+ gc.collect()
80
+
81
  return summaries
82
 
83