Spaces:
Runtime error
Runtime error
Commit
·
fea35c3
1
Parent(s):
003983b
Fix file not found issue
Browse files
app.py
CHANGED
|
@@ -80,10 +80,9 @@ def transcribe(inputs, microphone):
|
|
| 80 |
srtFilename = os.path.join("output/SrtFiles", inputs.split(
|
| 81 |
'/')[-1].split('.')[0]+'.srt')
|
| 82 |
|
| 83 |
-
# --------------------------------------------------- Clear the file ---------------------------------------------------
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
srtFile.truncate()
|
| 87 |
|
| 88 |
# --------------------------------------------------- Write the file ---------------------------------------------------
|
| 89 |
segments = result['segments']
|
|
|
|
| 80 |
srtFilename = os.path.join("output/SrtFiles", inputs.split(
|
| 81 |
'/')[-1].split('.')[0]+'.srt')
|
| 82 |
|
| 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']
|