/
melgen.h
42 lines (27 loc) · 1.06 KB
/
melgen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MELGEN_H
#define MELGEN_H
#include "ext/CppFlow/ops.h"
#include "ext/CppFlow/model.h"
#include "VoxCommon.hpp"
#include <memory>
// MelGen: base virtual class for mel generators
class MelGen
{
private:
public:
ETTSRepo::Enum CurrentRepo;
MelGen();
MelGen(const std::string& SavedModelFolder,ETTSRepo::Enum InTTSRepo);
// Generic inference function
// Utilize ArgsFloat and ArgsInt for additional arguments for certain models
virtual TFTensor<float> DoInference(const std::vector<int32_t>& InputIDs,const std::vector<float>& ArgsFloat,const std::vector<int32_t> ArgsInt, int32_t SpeakerID = 0, int32_t EmotionID = -1) = 0;
/*
Initialize and load the model
-> SavedModelFolder: Folder where the .pb, variables, and other characteristics of the exported SavedModel
<- Returns: (bool)Success
*/
virtual bool Initialize(const std::string& SavedModelFolder, ETTSRepo::Enum InTTSRepo);
std::unique_ptr<cppflow::model> CurrentMdl;
inline ETTSRepo::Enum GetCurrentRepo() {return CurrentRepo;}
};
#endif // MELGEN_H