Skip to content

Commit ad0b2b3

Browse files
committed
add changelog and a comment
1 parent bbcc23d commit ad0b2b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog/5529.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix memory leak problem on increasing number of calls to ``/model/parse`` endpoint.

rasa/utils/tensorflow/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ def predict(self, predict_data: RasaModelData) -> Dict[Text, tf.Tensor]:
206206
logger.debug("There is no tensorflow prediction graph.")
207207
self.build_for_predict(predict_data)
208208

209-
batch_in = predict_data.prepare_batch(predict_data.data, 0, 1)
209+
# Prepare a single batch of size 1
210+
batch_in = predict_data.prepare_batch(start=0, end=1)
210211

211212
self._training = False # needed for eager mode
212213
return self._predict_function(batch_in)

0 commit comments

Comments
 (0)