18 #include "fastdeploy/fastdeploy_model.h" 19 #include "fastdeploy/utils/unique_ptr.h" 27 class PredictionOption;
29 class FASTDEPLOY_DECL TextModel :
public FastDeployModel {
31 virtual std::string ModelName()
const {
return "TextModel"; }
32 virtual bool Predict(
const std::string& raw_text, Result* result,
33 const PredictionOption& option);
34 virtual bool PredictBatch(
const std::vector<std::string>& raw_text_array,
35 Result* result,
const PredictionOption& option);
36 template <
typename T,
typename... Args>
37 void SetPreprocessor(Args&&... args) {
38 preprocessor_ = utils::make_unique<T>(std::forward<Args>(args)...);
40 template <
typename T,
typename... Args>
41 void SetPostprocessor(Args&&... args) {
42 postprocessor_ = utils::make_unique<T>(std::forward<Args>(args)...);
46 std::unique_ptr<Preprocessor> preprocessor_;
47 std::unique_ptr<Postprocessor> postprocessor_;
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16