mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix(tools): suppress RuntimeWarnings in podcast audio generator (#10182)
This commit is contained in:
parent
ab127ba92e
commit
86739bea8b
|
@ -1,8 +1,8 @@
|
|||
import concurrent.futures
|
||||
import io
|
||||
import random
|
||||
import warnings
|
||||
from typing import Any, Literal, Optional, Union
|
||||
from warnings import catch_warnings
|
||||
|
||||
import openai
|
||||
|
||||
|
@ -10,7 +10,8 @@ from core.tools.entities.tool_entities import ToolInvokeMessage
|
|||
from core.tools.errors import ToolParameterValidationError, ToolProviderCredentialValidationError
|
||||
from core.tools.tool.builtin_tool import BuiltinTool
|
||||
|
||||
with catch_warnings(action="ignore", category=RuntimeWarning):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore")
|
||||
from pydub import AudioSegment
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user