Spaces:
Running
Running
jhj0517
commited on
Commit
·
b865fea
1
Parent(s):
3ea3fd0
debug decoration
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -59,7 +59,8 @@ class WhisperBase(ABC):
|
|
| 59 |
):
|
| 60 |
pass
|
| 61 |
|
| 62 |
-
|
|
|
|
| 63 |
def run(self,
|
| 64 |
audio: Union[str, BinaryIO, np.ndarray],
|
| 65 |
*whisper_params,
|
|
@@ -160,13 +161,11 @@ class WhisperBase(ABC):
|
|
| 160 |
try:
|
| 161 |
files_info = {}
|
| 162 |
for file in files:
|
| 163 |
-
print("run started: ")
|
| 164 |
transcribed_segments, time_for_task = self.run(
|
| 165 |
file.name,
|
| 166 |
*whisper_params,
|
| 167 |
progress=progress
|
| 168 |
)
|
| 169 |
-
print("run finished: ")
|
| 170 |
|
| 171 |
file_name, file_ext = os.path.splitext(os.path.basename(file.name))
|
| 172 |
file_name = safe_filename(file_name)
|
|
@@ -196,7 +195,7 @@ class WhisperBase(ABC):
|
|
| 196 |
except Exception as e:
|
| 197 |
print(f"Error transcribing file: {e}")
|
| 198 |
finally:
|
| 199 |
-
#self.release_cuda_memory()
|
| 200 |
if not files:
|
| 201 |
self.remove_input_files([file.name for file in files])
|
| 202 |
|
|
|
|
| 59 |
):
|
| 60 |
pass
|
| 61 |
|
| 62 |
+
# spaces is problematic
|
| 63 |
+
#@spaces.GPU(duration=120)
|
| 64 |
def run(self,
|
| 65 |
audio: Union[str, BinaryIO, np.ndarray],
|
| 66 |
*whisper_params,
|
|
|
|
| 161 |
try:
|
| 162 |
files_info = {}
|
| 163 |
for file in files:
|
|
|
|
| 164 |
transcribed_segments, time_for_task = self.run(
|
| 165 |
file.name,
|
| 166 |
*whisper_params,
|
| 167 |
progress=progress
|
| 168 |
)
|
|
|
|
| 169 |
|
| 170 |
file_name, file_ext = os.path.splitext(os.path.basename(file.name))
|
| 171 |
file_name = safe_filename(file_name)
|
|
|
|
| 195 |
except Exception as e:
|
| 196 |
print(f"Error transcribing file: {e}")
|
| 197 |
finally:
|
| 198 |
+
# self.release_cuda_memory()
|
| 199 |
if not files:
|
| 200 |
self.remove_input_files([file.name for file in files])
|
| 201 |
|