Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -446,7 +446,7 @@ class WhisperBase(ABC):
|
|
| 446 |
total_info += f"\nProcessed {file_count} {temp_file_count_text} in {self.format_time((time_end-time_start).total_seconds())}"
|
| 447 |
|
| 448 |
result_str = total_result.rstrip("\n")
|
| 449 |
-
result_str = self.transform_text_to_list(result_str)
|
| 450 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
| 451 |
|
| 452 |
return [result_str,result_file_path,total_info]
|
|
@@ -642,12 +642,12 @@ class WhisperBase(ABC):
|
|
| 642 |
gc.collect()
|
| 643 |
|
| 644 |
@staticmethod
|
| 645 |
-
def transform_text_to_list(inputdata: str) -> list:
|
| 646 |
outputdata = []
|
| 647 |
-
temp_inputdata = (inputdata.strip("\n")).split(
|
| 648 |
for temp_line in temp_inputdata:
|
| 649 |
temp_line_list = []
|
| 650 |
-
temp_line_items = temp_line.split(
|
| 651 |
for temp_line_item in temp_line_items:
|
| 652 |
temp_line_list.append(temp_line_item)
|
| 653 |
outputdata.append(temp_line_list)
|
|
|
|
| 446 |
total_info += f"\nProcessed {file_count} {temp_file_count_text} in {self.format_time((time_end-time_start).total_seconds())}"
|
| 447 |
|
| 448 |
result_str = total_result.rstrip("\n")
|
| 449 |
+
result_str = self.transform_text_to_list(result_str,"\t","\n")
|
| 450 |
result_file_path = [info['path'] for info in files_to_download.values()]
|
| 451 |
|
| 452 |
return [result_str,result_file_path,total_info]
|
|
|
|
| 642 |
gc.collect()
|
| 643 |
|
| 644 |
@staticmethod
|
| 645 |
+
def transform_text_to_list(inputdata: str,char_tab: str, char_newline: str) -> list:
|
| 646 |
outputdata = []
|
| 647 |
+
temp_inputdata = (inputdata.strip("\n")).split(char_newline)
|
| 648 |
for temp_line in temp_inputdata:
|
| 649 |
temp_line_list = []
|
| 650 |
+
temp_line_items = temp_line.split(char_tab)
|
| 651 |
for temp_line_item in temp_line_items:
|
| 652 |
temp_line_list.append(temp_line_item)
|
| 653 |
outputdata.append(temp_line_list)
|