Spaces:
Running
Running
jhj0517
commited on
Commit
·
f421dd9
1
Parent(s):
bb0ce27
Remove deprecated cache clean logic
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -246,8 +246,6 @@ class WhisperBase(ABC):
|
|
246 |
print(f"Error transcribing file: {e}")
|
247 |
finally:
|
248 |
self.release_cuda_memory()
|
249 |
-
if not files:
|
250 |
-
self.remove_input_files([file.name for file in files])
|
251 |
|
252 |
def transcribe_mic(self,
|
253 |
mic_audio: str,
|
@@ -303,7 +301,6 @@ class WhisperBase(ABC):
|
|
303 |
print(f"Error transcribing file: {e}")
|
304 |
finally:
|
305 |
self.release_cuda_memory()
|
306 |
-
self.remove_input_files([mic_audio])
|
307 |
|
308 |
def transcribe_youtube(self,
|
309 |
youtube_link: str,
|
@@ -364,17 +361,7 @@ class WhisperBase(ABC):
|
|
364 |
except Exception as e:
|
365 |
print(f"Error transcribing file: {e}")
|
366 |
finally:
|
367 |
-
|
368 |
-
if 'yt' not in locals():
|
369 |
-
yt = get_ytdata(youtube_link)
|
370 |
-
file_path = get_ytaudio(yt)
|
371 |
-
else:
|
372 |
-
file_path = get_ytaudio(yt)
|
373 |
-
|
374 |
-
self.release_cuda_memory()
|
375 |
-
self.remove_input_files([file_path])
|
376 |
-
except Exception as cleanup_error:
|
377 |
-
pass
|
378 |
|
379 |
@staticmethod
|
380 |
def generate_and_write_file(file_name: str,
|
|
|
246 |
print(f"Error transcribing file: {e}")
|
247 |
finally:
|
248 |
self.release_cuda_memory()
|
|
|
|
|
249 |
|
250 |
def transcribe_mic(self,
|
251 |
mic_audio: str,
|
|
|
301 |
print(f"Error transcribing file: {e}")
|
302 |
finally:
|
303 |
self.release_cuda_memory()
|
|
|
304 |
|
305 |
def transcribe_youtube(self,
|
306 |
youtube_link: str,
|
|
|
361 |
except Exception as e:
|
362 |
print(f"Error transcribing file: {e}")
|
363 |
finally:
|
364 |
+
self.release_cuda_memory()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
|
366 |
@staticmethod
|
367 |
def generate_and_write_file(file_name: str,
|