mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 17:47:06 +08:00
Fix: NoneType += str error in openai_source.py
- Add guard for reasoning_content before += operation - Fix MessageList.vue closing tag parsing error - Fix MessagePartsRenderer.vue v-if multiline attribute - Fix sensevoice_selfhosted_source.py model type annotation - Remove unused imports from tencent_record_helper.py - Fix xinference_rerank_source.py unused import - Fix chat.py pending_tool_calls type annotation
This commit is contained in:
@@ -6,7 +6,7 @@ LastEditTime: 2025-02-25 14:06:30
|
||||
import asyncio
|
||||
import re
|
||||
from datetime import datetime
|
||||
from typing import Protocol
|
||||
from typing import Protocol, cast
|
||||
|
||||
import anyio
|
||||
from funasr_onnx import SenseVoiceSmall
|
||||
@@ -55,7 +55,10 @@ class ProviderSenseVoiceSTTSelfHost(STTProvider):
|
||||
# 将模型加载放到线程池中执行
|
||||
self.model = await asyncio.get_running_loop().run_in_executor(
|
||||
None,
|
||||
lambda: SenseVoiceSmall(self.model_name, quantize=True, batch_size=16),
|
||||
lambda: cast(
|
||||
SenseVoiceModel,
|
||||
SenseVoiceSmall(self.model_name, quantize=True, batch_size=16),
|
||||
),
|
||||
)
|
||||
|
||||
logger.info("SenseVoice 模型加载完成。")
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from xinference_client.client.restful.async_restful_client import AsyncClient as Client
|
||||
from xinference_client.client.restful.async_restful_client import (
|
||||
AsyncRESTfulModelHandle,
|
||||
AsyncRESTfulRerankModelHandle,
|
||||
)
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ from astrbot.core import logger
|
||||
from astrbot.core.utils.astrbot_path import get_astrbot_temp_path
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
import pilk # optional; stubs live under types/pilk.pyi
|
||||
pass # pilk/p Moffmpeg are runtime optional deps
|
||||
|
||||
|
||||
async def tencent_silk_to_wav(silk_path: str, output_path: str) -> str:
|
||||
|
||||
@@ -105,7 +105,7 @@ class BotMessageAccumulator:
|
||||
def __init__(self) -> None:
|
||||
self.parts: list[dict] = []
|
||||
self.pending_text = ""
|
||||
self.pending_tool_calls: dict[str, dict] = {}
|
||||
self.pending_tool_calls: dict[str, Any] = {}
|
||||
|
||||
def has_content(self) -> bool:
|
||||
return bool(self.parts or self.pending_text or self.pending_tool_calls)
|
||||
|
||||
Reference in New Issue
Block a user