修复本地语音识别插件的依赖导入问题喵~
This commit is contained in:
@@ -6,4 +6,5 @@ __plugin_meta__ = PluginMetadata(
|
||||
usage="在 bot_config.toml 中将 asr_provider 设置为 'local' 即可启用",
|
||||
version="0.1.0",
|
||||
author="Elysia",
|
||||
python_dependencies=["openai-whisper"],
|
||||
)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import asyncio
|
||||
from typing import ClassVar
|
||||
|
||||
import whisper
|
||||
|
||||
from src.common.logger import get_logger
|
||||
from src.plugin_system import BasePlugin, ComponentInfo, register_plugin
|
||||
from src.plugin_system.base.base_tool import BaseTool
|
||||
@@ -35,6 +33,8 @@ class LocalASRTool(BaseTool):
|
||||
if _whisper_model is None and not _is_loading:
|
||||
_is_loading = True
|
||||
try:
|
||||
import whisper
|
||||
|
||||
model_size = plugin_config.get("whisper", {}).get("model_size", "tiny")
|
||||
device = plugin_config.get("whisper", {}).get("device", "cpu")
|
||||
logger.info(f"正在预加载 Whisper ASR 模型: {model_size} ({device})")
|
||||
|
||||
Reference in New Issue
Block a user