Path: blob/master/examples/cppwin/TensorflowTTSCppInference/tfg2p.h
1559 views
#ifndef TFG2P_H1#define TFG2P_H2#include "ext/CppFlow/include/Model.h"3#include "VoxCommon.hpp"456class TFG2P7{8private:9Model* G2P;1011public:12TFG2P();13TFG2P(const std::string& SavedModelFolder);1415/*16Initialize and load the model1718-> SavedModelFolder: Folder where the .pb, variables, and other characteristics of the exported SavedModel19<- Returns: (bool)Success20*/21bool Initialize(const std::string& SavedModelFolder);2223/*24Do inference on a G2P-TF-RNN model.2526-> InputIDs: Input IDs of tokens for inference27-> Temperature: Temperature of the RNN, values higher than 0.1 cause instability.2829<- Returns: TFTensor<int32_t> containing phoneme IDs30*/31TFTensor<int32_t> DoInference(const std::vector<int32_t>& InputIDs, float Temperature = 0.1f);3233~TFG2P();3435};3637#endif // TFG2P_H383940