- Implemented core model components in `modules.py` including various convolutional layers and normalization techniques. - Added transformation functions in `transforms.py` for piecewise rational quadratic transformations. - Created utility functions in `utils.py` for checkpoint management, logging, and hyperparameter handling. - Introduced monotonic alignment functionality with Cython optimization in `monotonic_align`. - Developed a minimal inference server in `server.py` to handle synthesis requests. - Updated requirements to include necessary dependencies for Cython and scipy.
326 lines
10 KiB
Go
326 lines
10 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc (unknown)
|
|
// source: tts/v1/tts.proto
|
|
|
|
package ttsv1
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
// optional fields let the gateway apply its own defaults (matching the
|
|
// reference uma-tts-api's noise_scale=0.37, noise_scale_w=0.46,
|
|
// length_scale=1.3) when a client omits them.
|
|
type SynthesizeRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
SpeakerName string `protobuf:"bytes,1,opt,name=speaker_name,json=speakerName,proto3" json:"speaker_name,omitempty"`
|
|
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
|
|
NoiseScale *float32 `protobuf:"fixed32,3,opt,name=noise_scale,json=noiseScale,proto3,oneof" json:"noise_scale,omitempty"`
|
|
NoiseScaleW *float32 `protobuf:"fixed32,4,opt,name=noise_scale_w,json=noiseScaleW,proto3,oneof" json:"noise_scale_w,omitempty"`
|
|
LengthScale *float32 `protobuf:"fixed32,5,opt,name=length_scale,json=lengthScale,proto3,oneof" json:"length_scale,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SynthesizeRequest) Reset() {
|
|
*x = SynthesizeRequest{}
|
|
mi := &file_tts_v1_tts_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SynthesizeRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SynthesizeRequest) ProtoMessage() {}
|
|
|
|
func (x *SynthesizeRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_tts_v1_tts_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SynthesizeRequest.ProtoReflect.Descriptor instead.
|
|
func (*SynthesizeRequest) Descriptor() ([]byte, []int) {
|
|
return file_tts_v1_tts_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *SynthesizeRequest) GetSpeakerName() string {
|
|
if x != nil {
|
|
return x.SpeakerName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SynthesizeRequest) GetText() string {
|
|
if x != nil {
|
|
return x.Text
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SynthesizeRequest) GetNoiseScale() float32 {
|
|
if x != nil && x.NoiseScale != nil {
|
|
return *x.NoiseScale
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *SynthesizeRequest) GetNoiseScaleW() float32 {
|
|
if x != nil && x.NoiseScaleW != nil {
|
|
return *x.NoiseScaleW
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *SynthesizeRequest) GetLengthScale() float32 {
|
|
if x != nil && x.LengthScale != nil {
|
|
return *x.LengthScale
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type SynthesizeResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Audio []byte `protobuf:"bytes,1,opt,name=audio,proto3" json:"audio,omitempty"`
|
|
MimeType string `protobuf:"bytes,2,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SynthesizeResponse) Reset() {
|
|
*x = SynthesizeResponse{}
|
|
mi := &file_tts_v1_tts_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SynthesizeResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SynthesizeResponse) ProtoMessage() {}
|
|
|
|
func (x *SynthesizeResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_tts_v1_tts_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SynthesizeResponse.ProtoReflect.Descriptor instead.
|
|
func (*SynthesizeResponse) Descriptor() ([]byte, []int) {
|
|
return file_tts_v1_tts_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *SynthesizeResponse) GetAudio() []byte {
|
|
if x != nil {
|
|
return x.Audio
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SynthesizeResponse) GetMimeType() string {
|
|
if x != nil {
|
|
return x.MimeType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ListSpeakersRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Search string `protobuf:"bytes,1,opt,name=search,proto3" json:"search,omitempty"` // case-insensitive substring filter; empty returns all speakers
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ListSpeakersRequest) Reset() {
|
|
*x = ListSpeakersRequest{}
|
|
mi := &file_tts_v1_tts_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ListSpeakersRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListSpeakersRequest) ProtoMessage() {}
|
|
|
|
func (x *ListSpeakersRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_tts_v1_tts_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListSpeakersRequest.ProtoReflect.Descriptor instead.
|
|
func (*ListSpeakersRequest) Descriptor() ([]byte, []int) {
|
|
return file_tts_v1_tts_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *ListSpeakersRequest) GetSearch() string {
|
|
if x != nil {
|
|
return x.Search
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ListSpeakersResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
SpeakerNames []string `protobuf:"bytes,1,rep,name=speaker_names,json=speakerNames,proto3" json:"speaker_names,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ListSpeakersResponse) Reset() {
|
|
*x = ListSpeakersResponse{}
|
|
mi := &file_tts_v1_tts_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ListSpeakersResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListSpeakersResponse) ProtoMessage() {}
|
|
|
|
func (x *ListSpeakersResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_tts_v1_tts_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListSpeakersResponse.ProtoReflect.Descriptor instead.
|
|
func (*ListSpeakersResponse) Descriptor() ([]byte, []int) {
|
|
return file_tts_v1_tts_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *ListSpeakersResponse) GetSpeakerNames() []string {
|
|
if x != nil {
|
|
return x.SpeakerNames
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var File_tts_v1_tts_proto protoreflect.FileDescriptor
|
|
|
|
const file_tts_v1_tts_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x10tts/v1/tts.proto\x12\x06tts.v1\"\xf4\x01\n" +
|
|
"\x11SynthesizeRequest\x12!\n" +
|
|
"\fspeaker_name\x18\x01 \x01(\tR\vspeakerName\x12\x12\n" +
|
|
"\x04text\x18\x02 \x01(\tR\x04text\x12$\n" +
|
|
"\vnoise_scale\x18\x03 \x01(\x02H\x00R\n" +
|
|
"noiseScale\x88\x01\x01\x12'\n" +
|
|
"\rnoise_scale_w\x18\x04 \x01(\x02H\x01R\vnoiseScaleW\x88\x01\x01\x12&\n" +
|
|
"\flength_scale\x18\x05 \x01(\x02H\x02R\vlengthScale\x88\x01\x01B\x0e\n" +
|
|
"\f_noise_scaleB\x10\n" +
|
|
"\x0e_noise_scale_wB\x0f\n" +
|
|
"\r_length_scale\"G\n" +
|
|
"\x12SynthesizeResponse\x12\x14\n" +
|
|
"\x05audio\x18\x01 \x01(\fR\x05audio\x12\x1b\n" +
|
|
"\tmime_type\x18\x02 \x01(\tR\bmimeType\"-\n" +
|
|
"\x13ListSpeakersRequest\x12\x16\n" +
|
|
"\x06search\x18\x01 \x01(\tR\x06search\";\n" +
|
|
"\x14ListSpeakersResponse\x12#\n" +
|
|
"\rspeaker_names\x18\x01 \x03(\tR\fspeakerNames2\x9c\x01\n" +
|
|
"\n" +
|
|
"TTSService\x12C\n" +
|
|
"\n" +
|
|
"Synthesize\x12\x19.tts.v1.SynthesizeRequest\x1a\x1a.tts.v1.SynthesizeResponse\x12I\n" +
|
|
"\fListSpeakers\x12\x1b.tts.v1.ListSpeakersRequest\x1a\x1c.tts.v1.ListSpeakersResponseB6Z4gitea.nik4nao.com/nik/home-services/gen/tts/v1;ttsv1b\x06proto3"
|
|
|
|
var (
|
|
file_tts_v1_tts_proto_rawDescOnce sync.Once
|
|
file_tts_v1_tts_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_tts_v1_tts_proto_rawDescGZIP() []byte {
|
|
file_tts_v1_tts_proto_rawDescOnce.Do(func() {
|
|
file_tts_v1_tts_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tts_v1_tts_proto_rawDesc), len(file_tts_v1_tts_proto_rawDesc)))
|
|
})
|
|
return file_tts_v1_tts_proto_rawDescData
|
|
}
|
|
|
|
var file_tts_v1_tts_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
var file_tts_v1_tts_proto_goTypes = []any{
|
|
(*SynthesizeRequest)(nil), // 0: tts.v1.SynthesizeRequest
|
|
(*SynthesizeResponse)(nil), // 1: tts.v1.SynthesizeResponse
|
|
(*ListSpeakersRequest)(nil), // 2: tts.v1.ListSpeakersRequest
|
|
(*ListSpeakersResponse)(nil), // 3: tts.v1.ListSpeakersResponse
|
|
}
|
|
var file_tts_v1_tts_proto_depIdxs = []int32{
|
|
0, // 0: tts.v1.TTSService.Synthesize:input_type -> tts.v1.SynthesizeRequest
|
|
2, // 1: tts.v1.TTSService.ListSpeakers:input_type -> tts.v1.ListSpeakersRequest
|
|
1, // 2: tts.v1.TTSService.Synthesize:output_type -> tts.v1.SynthesizeResponse
|
|
3, // 3: tts.v1.TTSService.ListSpeakers:output_type -> tts.v1.ListSpeakersResponse
|
|
2, // [2:4] is the sub-list for method output_type
|
|
0, // [0:2] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_tts_v1_tts_proto_init() }
|
|
func file_tts_v1_tts_proto_init() {
|
|
if File_tts_v1_tts_proto != nil {
|
|
return
|
|
}
|
|
file_tts_v1_tts_proto_msgTypes[0].OneofWrappers = []any{}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_tts_v1_tts_proto_rawDesc), len(file_tts_v1_tts_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 4,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_tts_v1_tts_proto_goTypes,
|
|
DependencyIndexes: file_tts_v1_tts_proto_depIdxs,
|
|
MessageInfos: file_tts_v1_tts_proto_msgTypes,
|
|
}.Build()
|
|
File_tts_v1_tts_proto = out.File
|
|
file_tts_v1_tts_proto_goTypes = nil
|
|
file_tts_v1_tts_proto_depIdxs = nil
|
|
}
|