Update modules/whisper/whisper_base.py
Browse files- modules/whisper/whisper_base.py +20 -20
modules/whisper/whisper_base.py
CHANGED
@@ -618,27 +618,27 @@ class WhisperBase(ABC):
|
|
618 |
gc.collect()
|
619 |
|
620 |
@staticmethod
|
621 |
-
def transform_text_to_list(inputdata: str) -> list:
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
|
|
|
|
|
|
|
|
|
|
632 |
col_time = temp_line_items[0]
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
col_time = temp_line_items[0]
|
638 |
-
col_speaker = temp_line_items[1]
|
639 |
-
col_text = temp_line_items[2]
|
640 |
-
|
641 |
-
outputdata.append([col_time,col_speaker,col_text])
|
642 |
|
643 |
return outputdata
|
644 |
|
|
|
618 |
gc.collect()
|
619 |
|
620 |
@staticmethod
|
621 |
+
def transform_text_to_list(inputdata: str) -> list:
|
622 |
+
outputdata = []
|
623 |
+
temp_inputdata = inputdata.split("#NEWLINE#")
|
624 |
+
for temp_line in temp_inputdata:
|
625 |
+
temp_line_items = temp_line.split("#TAB#")
|
626 |
+
col_time,col_speaker,col_text = "","",""
|
627 |
+
|
628 |
+
if len(temp_line_items)==1:
|
629 |
+
col_text = temp_line_items[0]
|
630 |
+
if len(temp_line_items)==2:
|
631 |
+
if (temp_line_items[0])[0].isdigit():
|
632 |
+
col_time = temp_line_items[0]
|
633 |
+
else:
|
634 |
+
col_speaker = temp_line_items[0]
|
635 |
+
col_text = temp_line_items[1]
|
636 |
+
if len(temp_line_items)==3:
|
637 |
col_time = temp_line_items[0]
|
638 |
+
col_speaker = temp_line_items[1]
|
639 |
+
col_text = temp_line_items[2]
|
640 |
+
|
641 |
+
outputdata.append([col_time,col_speaker,col_text])
|
|
|
|
|
|
|
|
|
|
|
642 |
|
643 |
return outputdata
|
644 |
|