helenai commited on
Commit
d960dc2
1 Parent(s): c36aef1

Close matplotlib figure

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -30,6 +30,7 @@ def plot_histogram(data):
30
  plt.title("Histogram of number of tokens per dataset item")
31
  buf = io.BytesIO()
32
  plt.savefig(buf, format="png")
 
33
  buf.seek(0)
34
  im = Image.open(buf)
35
  return im
 
30
  plt.title("Histogram of number of tokens per dataset item")
31
  buf = io.BytesIO()
32
  plt.savefig(buf, format="png")
33
+ plt.close()
34
  buf.seek(0)
35
  im = Image.open(buf)
36
  return im