forked from mudler/LocalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TTS endpoint: add optional language paramter
Signed-off-by: blob42 <contact@blob42.xyz>
- Loading branch information
Showing
8 changed files
with
83 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,61 @@ | ||
package schema | ||
|
||
import ( | ||
gopsutil "github.com/shirou/gopsutil/v3/process" | ||
) | ||
|
||
type BackendMonitorRequest struct { | ||
Model string `json:"model" yaml:"model"` | ||
} | ||
|
||
type BackendMonitorResponse struct { | ||
MemoryInfo *gopsutil.MemoryInfoStat | ||
MemoryPercent float32 | ||
CPUPercent float64 | ||
} | ||
|
||
type TTSRequest struct { | ||
Model string `json:"model" yaml:"model"` | ||
Input string `json:"input" yaml:"input"` | ||
Voice string `json:"voice" yaml:"voice"` | ||
Backend string `json:"backend" yaml:"backend"` | ||
} | ||
|
||
type StoresSet struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
} | ||
|
||
type StoresDelete struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys"` | ||
} | ||
|
||
type StoresGet struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
} | ||
|
||
type StoresGetResponse struct { | ||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
} | ||
|
||
type StoresFind struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Key []float32 `json:"key" yaml:"key"` | ||
Topk int `json:"topk" yaml:"topk"` | ||
} | ||
|
||
type StoresFindResponse struct { | ||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
Similarities []float32 `json:"similarities" yaml:"similarities"` | ||
} | ||
package schema | ||
|
||
import ( | ||
gopsutil "github.com/shirou/gopsutil/v3/process" | ||
) | ||
|
||
type BackendMonitorRequest struct { | ||
Model string `json:"model" yaml:"model"` | ||
} | ||
|
||
type BackendMonitorResponse struct { | ||
MemoryInfo *gopsutil.MemoryInfoStat | ||
MemoryPercent float32 | ||
CPUPercent float64 | ||
} | ||
|
||
// @Descsription TTS request body | ||
type TTSRequest struct { | ||
Model string `json:"model" yaml:"model"` // model name or full path | ||
Input string `json:"input" yaml:"input"` // text input | ||
Voice string `json:"voice" yaml:"voice"` // voice audio file or speaker id | ||
Backend string `json:"backend" yaml:"backend"` | ||
Language string `json:"language,omitempty" yaml:"language,omitempty"` // (optional) language to use with TTS model | ||
} | ||
|
||
type StoresSet struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
} | ||
|
||
type StoresDelete struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys"` | ||
} | ||
|
||
type StoresGet struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
} | ||
|
||
type StoresGetResponse struct { | ||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
} | ||
|
||
type StoresFind struct { | ||
Store string `json:"store,omitempty" yaml:"store,omitempty"` | ||
|
||
Key []float32 `json:"key" yaml:"key"` | ||
Topk int `json:"topk" yaml:"topk"` | ||
} | ||
|
||
type StoresFindResponse struct { | ||
Keys [][]float32 `json:"keys" yaml:"keys"` | ||
Values []string `json:"values" yaml:"values"` | ||
Similarities []float32 `json:"similarities" yaml:"similarities"` | ||
} |