Close matplotlib figure
Browse files
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
|