fix tts provider and lint
This commit is contained in:
parent
3e26c37db1
commit
a88b539402
2 changed files with 3 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func initPanicFile(panicFile string) io.WriteCloser {
|
func initPanicFile(panicFile string) io.WriteCloser {
|
||||||
file, err := os.OpenFile(panicFile, os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_APPEND, 0600)
|
file, err := os.OpenFile(panicFile, os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_APPEND, 0o600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("error in open panic: %v", err))
|
panic(fmt.Sprintf("error in open panic: %v", err))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ func (t *OpenAITTSProvider) Synthesize(ctx context.Context, text string) (io.Rea
|
||||||
|
|
||||||
func DetectTTS(cfg *config.Config) TTSProvider {
|
func DetectTTS(cfg *config.Config) TTSProvider {
|
||||||
for _, mc := range cfg.ModelList {
|
for _, mc := range cfg.ModelList {
|
||||||
if strings.Contains(strings.ToLower(mc.ModelName), "tts") && mc.APIKey != "" {
|
if strings.Contains(strings.ToLower(mc.ModelName), "tts") && mc.APIKey() != "" {
|
||||||
return NewOpenAITTSProvider(mc.APIKey, mc.APIBase, mc.Proxy)
|
return NewOpenAITTSProvider(mc.APIKey(), mc.APIBase, mc.Proxy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue