Skip to content

Commit

Permalink
fix: fish audio wrong validate credentials interface (#11019)
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
  • Loading branch information
yihong0618 authored Nov 23, 2024
1 parent d3051ee commit 448a19b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def validate_provider_credentials(self, credentials: dict) -> None:
"""
try:
model_instance = self.get_model_instance(ModelType.TTS)
model_instance.validate_credentials(credentials=credentials)
# FIXME fish tts do not have model for now, so set it to empty string instead
model_instance.validate_credentials(model="", credentials=credentials)
except CredentialsValidateFailedError as ex:
raise ex
except Exception as ex:
Expand Down
4 changes: 2 additions & 2 deletions api/core/model_runtime/model_providers/fishaudio/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _invoke(
voice=voice,
)

def validate_credentials(self, credentials: dict, user: Optional[str] = None) -> None:
def validate_credentials(self, model: str, credentials: dict, user: Optional[str] = None) -> None:
"""
Validate credentials for text2speech model
Expand All @@ -76,7 +76,7 @@ def validate_credentials(self, credentials: dict, user: Optional[str] = None) ->

try:
self.get_tts_model_voices(
None,
"",
credentials={
"api_key": credentials["api_key"],
"api_base": credentials["api_base"],
Expand Down

0 comments on commit 448a19b

Please sign in to comment.