Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ import re
|
|
| 15 |
import matplotlib.pyplot as plt
|
| 16 |
import io
|
| 17 |
import base64
|
|
|
|
| 18 |
|
| 19 |
# === Temp file cleanup ===
|
| 20 |
for pattern in ["/tmp/*.wav", "/tmp/*.mp3"]:
|
|
@@ -161,7 +162,7 @@ def generate_user_chart(user, metric):
|
|
| 161 |
plt.savefig(buf, format="png")
|
| 162 |
plt.close(fig)
|
| 163 |
buf.seek(0)
|
| 164 |
-
return
|
| 165 |
|
| 166 |
def tutor_feedback(audio_file, language, nickname):
|
| 167 |
if not audio_file or not os.path.exists(audio_file):
|
|
|
|
| 15 |
import matplotlib.pyplot as plt
|
| 16 |
import io
|
| 17 |
import base64
|
| 18 |
+
from PIL import Image
|
| 19 |
|
| 20 |
# === Temp file cleanup ===
|
| 21 |
for pattern in ["/tmp/*.wav", "/tmp/*.mp3"]:
|
|
|
|
| 162 |
plt.savefig(buf, format="png")
|
| 163 |
plt.close(fig)
|
| 164 |
buf.seek(0)
|
| 165 |
+
return Image.open(buf)
|
| 166 |
|
| 167 |
def tutor_feedback(audio_file, language, nickname):
|
| 168 |
if not audio_file or not os.path.exists(audio_file):
|