mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-12 23:02:35 +00:00
fix: correct empty STT_ENGINE handling and improve TTS error response (#20534)
- Remove incorrect 403 check that blocked STT when ENGINE="" (local whisper) - Change TTS empty ENGINE check from 403 to 404 for proper semantics
This commit is contained in:
parent
81510e9d8f
commit
9b9e6ce2ab
1 changed files with 2 additions and 8 deletions
|
|
@ -334,8 +334,8 @@ def load_speech_pipeline(request):
|
|||
async def speech(request: Request, user=Depends(get_verified_user)):
|
||||
if request.app.state.config.TTS_ENGINE == "":
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=ERROR_MESSAGES.NOT_FOUND,
|
||||
)
|
||||
|
||||
if user.role != "admin" and not has_permission(
|
||||
|
|
@ -1169,12 +1169,6 @@ def transcription(
|
|||
language: Optional[str] = Form(None),
|
||||
user=Depends(get_verified_user),
|
||||
):
|
||||
if request.app.state.config.STT_ENGINE == "":
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
|
||||
)
|
||||
|
||||
if user.role != "admin" and not has_permission(
|
||||
user.id, "chat.stt", request.app.state.config.USER_PERMISSIONS
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue