From 28ccfbfc51068a663a80764e14074df5edf2b5ba Mon Sep 17 00:00:00 2001
From: kongdeqiang <kongdeqiang960204@163.com>
Date: 星期五, 13 三月 2026 17:41:41 +0800
Subject: [PATCH] 提交
---
examples/industrial_data_pretraining/llm_asr/demo_speech2text.py | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/examples/industrial_data_pretraining/llm_asr/demo_speech2text.py b/examples/industrial_data_pretraining/llm_asr/demo_speech2text.py
index 072dcdf..77e1b28 100644
--- a/examples/industrial_data_pretraining/llm_asr/demo_speech2text.py
+++ b/examples/industrial_data_pretraining/llm_asr/demo_speech2text.py
@@ -3,20 +3,42 @@
# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
# MIT License (https://opensource.org/licenses/MIT)
+import json
+import os
+import sys
+
from funasr import AutoModel
+if len(sys.argv) > 1:
+ ckpt_dir = sys.argv[1]
+ ckpt_id = sys.argv[2]
+ jsonl = sys.argv[3]
+ output_dir = sys.argv[4]
+ device = sys.argv[5]
+else:
+ ckpt_dir = "/nfs/beinian.lzr/workspace/GPT-4o/Exp/exp6/5m-8gpu/exp6_speech2text_linear_ddp_0609"
+ ckpt_id = "model.pt.ep0.90000"
+ jsonl = "/nfs/beinian.lzr/workspace/GPT-4o/Data/Speech2Text/TestData/aishell1_test_speech2text.jsonl"
+ dataset = jsonl.split("/")[-1]
+ output_dir = os.path.join(ckpt_dir, f"inference-{ckpt_id}", dataset)
+ device = "cuda:0"
+
+
model = AutoModel(
- model="/nfs/beinian.lzr/workspace/GPT-4o/Exp/exp6/4m-8gpu/exp6_speech2text_0607_linear_ddp",
+ model=ckpt_dir,
+ init_param=f"{os.path.join(ckpt_dir, ckpt_id)}",
+ output_dir=output_dir,
+ device=device,
+ fp16=False,
+ bf16=False,
+ llm_dtype="bf16",
)
-jsonl = (
- "/nfs/beinian.lzr/workspace/GPT-4o/Data/Speech2Text/TestData/aishell1_test_speech2text.jsonl"
-)
with open(jsonl, "r") as f:
lines = f.readlines()
-tearchforing = True
+tearchforing = False
for i, line in enumerate(lines):
data_dict = json.loads(line.strip())
data = data_dict["messages"]
--
Gitblit v1.9.1