Spaces:
Build error
Build error
Commit ·
12001bc
1
Parent(s): fea35c3
Fix file not found issue
Browse files
app.py
CHANGED
|
@@ -83,6 +83,8 @@ def transcribe(inputs, microphone):
|
|
| 83 |
# --------------------------------------------------- Clear the file if exists ---------------------------------------------------
|
| 84 |
if os.path.exists(srtFilename):
|
| 85 |
os.remove(srtFilename)
|
|
|
|
|
|
|
| 86 |
|
| 87 |
# --------------------------------------------------- Write the file ---------------------------------------------------
|
| 88 |
segments = result['segments']
|
|
|
|
| 83 |
# --------------------------------------------------- Clear the file if exists ---------------------------------------------------
|
| 84 |
if os.path.exists(srtFilename):
|
| 85 |
os.remove(srtFilename)
|
| 86 |
+
with open(srtFilename, 'w', encoding='utf-8') as srtFile:
|
| 87 |
+
srtFile.write('')
|
| 88 |
|
| 89 |
# --------------------------------------------------- Write the file ---------------------------------------------------
|
| 90 |
segments = result['segments']
|