mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-05-04 22:30:36 +00:00
improve default_models
This commit is contained in:
parent
4f586ad513
commit
223f1bdaf5
4 changed files with 20 additions and 5 deletions
|
|
@ -105,6 +105,22 @@ class ModelManager:
|
|||
raise RuntimeError("Failed to initialize default models configuration")
|
||||
return self._default_models
|
||||
|
||||
@property
|
||||
def speech_to_text(self, **kwargs) -> SpeechToTextModel:
|
||||
"""Get the default speech-to-text model"""
|
||||
model = self.get_default_model("speech_to_text", **kwargs)
|
||||
if not isinstance(model, SpeechToTextModel):
|
||||
raise TypeError(f"Expected SpeechToTextModel but got {type(model)}")
|
||||
return model
|
||||
|
||||
@property
|
||||
def text_to_speech(self, **kwargs) -> TextToSpeechModel:
|
||||
"""Get the default text-to-speech model"""
|
||||
model = self.get_default_model("text_to_speech", **kwargs)
|
||||
if not isinstance(model, TextToSpeechModel):
|
||||
raise TypeError(f"Expected TextToSpeechModel but got {type(model)}")
|
||||
return model
|
||||
|
||||
@property
|
||||
def embedding_model(self, **kwargs) -> EmbeddingModel:
|
||||
"""Get the default embedding model"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue