Spaces:
Runtime error
Runtime error
Commit
·
22c9184
1
Parent(s):
1b0ab4a
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,12 @@ def CreateFile(filename):
|
|
18 |
return filename
|
19 |
|
20 |
def RemoveFile(filename):
|
21 |
-
if (os.path.
|
22 |
os.remove(filename)
|
23 |
|
24 |
def RemoveAllFiles():
|
25 |
for file in __FILES:
|
26 |
-
if (os.path.
|
27 |
os.remove(file)
|
28 |
|
29 |
def Transcribe(audio="temp_audio.wav"):
|
@@ -111,7 +111,7 @@ def AudioTranscribe(audio, retries=5):
|
|
111 |
except Exception as ex:
|
112 |
traceback.print_exc()
|
113 |
return AudioTranscribe(audio, retries-1)
|
114 |
-
if not (os.path.
|
115 |
return AudioTranscribe(audio, retries-1)
|
116 |
return Transcribe()
|
117 |
else:
|
@@ -125,7 +125,7 @@ def VideoTranscribe(video, retries=5):
|
|
125 |
except Exception as ex:
|
126 |
traceback.print_exc()
|
127 |
return VideoTranscribe(video, retries-1)
|
128 |
-
if not (os.path.
|
129 |
return VideoTranscribe(video, retries-1)
|
130 |
return Transcribe()
|
131 |
else:
|
|
|
18 |
return filename
|
19 |
|
20 |
def RemoveFile(filename):
|
21 |
+
if (os.path.isfile(filename)):
|
22 |
os.remove(filename)
|
23 |
|
24 |
def RemoveAllFiles():
|
25 |
for file in __FILES:
|
26 |
+
if (os.path.isfile(file)):
|
27 |
os.remove(file)
|
28 |
|
29 |
def Transcribe(audio="temp_audio.wav"):
|
|
|
111 |
except Exception as ex:
|
112 |
traceback.print_exc()
|
113 |
return AudioTranscribe(audio, retries-1)
|
114 |
+
if not (os.path.isfile("temp_audio.wav")):
|
115 |
return AudioTranscribe(audio, retries-1)
|
116 |
return Transcribe()
|
117 |
else:
|
|
|
125 |
except Exception as ex:
|
126 |
traceback.print_exc()
|
127 |
return VideoTranscribe(video, retries-1)
|
128 |
+
if not (os.path.isfile("temp_audio.wav")):
|
129 |
return VideoTranscribe(video, retries-1)
|
130 |
return Transcribe()
|
131 |
else:
|