Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -239,6 +239,19 @@ def upload_audio():
|
|
239 |
def reset():
|
240 |
global users
|
241 |
users = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
return jsonify({"status": "success", "message": "Users reset"}), 200
|
243 |
|
244 |
|
|
|
239 |
def reset():
|
240 |
global users
|
241 |
users = []
|
242 |
+
global total_audio
|
243 |
+
global transcription_text
|
244 |
+
process.delete_files_in_directory(total_audio)
|
245 |
+
process.delete_files_in_directory('/tmp/data/transcription_audio')
|
246 |
+
try:
|
247 |
+
if os.path.exists(transcription_text):
|
248 |
+
os.remove(transcription_text)
|
249 |
+
print(f"{transcription_text} を削除しました。")
|
250 |
+
else:
|
251 |
+
print(f"{transcription_text} は存在しません。")
|
252 |
+
except Exception as e:
|
253 |
+
print(f"エラーが発生しました: {e}")
|
254 |
+
transcription_text = ""
|
255 |
return jsonify({"status": "success", "message": "Users reset"}), 200
|
256 |
|
257 |
|