mirror of
https://github.com/modelscope/FunASR.git
synced 2026-10-12 02:19:18 +00:00
File diff suppressed because it is too large
Load Diff
@@ -155,9 +155,7 @@ def ch_number2digit(line):
|
||||
if line[i] in chsh:
|
||||
number_flag = 1
|
||||
if line[i] == "两":
|
||||
if (i == len(line) - 1) or (
|
||||
(line[i + 1] not in chsh.keys()) and (line[i + 1] not in bits.keys())
|
||||
):
|
||||
if (i == len(line) - 1) or ((line[i + 1] not in chsh.keys()) and (line[i + 1] not in bits.keys())):
|
||||
number_flag = -1
|
||||
if number_flag == 1:
|
||||
digit.append(chsh[line[i]])
|
||||
|
||||
@@ -86,9 +86,7 @@ def main_hydra(cfg: DictConfig):
|
||||
transcript_lines = f2.readlines()
|
||||
|
||||
if len(scp_lines) != len(transcript_lines):
|
||||
print(
|
||||
f"Warning: Line count mismatch - scp: {len(scp_lines)}, transcript: {len(transcript_lines)}"
|
||||
)
|
||||
print(f"Warning: Line count mismatch - scp: {len(scp_lines)}, transcript: {len(transcript_lines)}")
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B")
|
||||
processor = LineProcessor(tokenizer)
|
||||
@@ -102,10 +100,7 @@ def main_hydra(cfg: DictConfig):
|
||||
with tqdm(total=len(data_pairs), desc="Processing") as pbar:
|
||||
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||
with open(jsonl_file, "w") as f_out:
|
||||
futures = {
|
||||
executor.submit(processor.process_line, pair): i
|
||||
for i, pair in enumerate(data_pairs)
|
||||
}
|
||||
futures = {executor.submit(processor.process_line, pair): i for i, pair in enumerate(data_pairs)}
|
||||
|
||||
for future in as_completed(futures):
|
||||
result = future.result()
|
||||
|
||||
Reference in New Issue
Block a user