Skip to content

Commit b25472b

Browse files
authored
修复循环导入导致FunASRNano无法自动注册问题 (#2771)
从funasr导入AutoModel时,其会自动导入注册的模块,但是此时fun_asr_nano 在模块级别又导入了AutoModel,形成循环导入,导致FunASRNano 模型注册失败,不能直接使用AutoModel加载。
1 parent b651224 commit b25472b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

funasr/models/fun_asr_nano/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import torch
1111
import torch.nn as nn
12-
from funasr import AutoModel
1312
from funasr.metrics.compute_acc import compute_accuracy
1413
from funasr.register import tables
1514
from funasr.train_utils.device_funcs import force_gatherable, to_device
@@ -42,6 +41,7 @@ def __init__(
4241
"activation_checkpoint", False
4342
)
4443
if hub == "ms":
44+
from funasr import AutoModel
4545
model = AutoModel(model=audio_encoder, model_revision="master")
4646
audio_encoder_output_size = (
4747
model.model.encoder_output_size

0 commit comments

Comments
 (0)