#include "components/optimization_guide/core/bert_model_executor.h"
#include "base/trace_event/trace_event.h"
#include "base/types/expected.h"
#include "components/optimization_guide/core/model_util.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/tflite_op_resolver.h"
#include "third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/bert_nl_classifier.h"
namespace optimization_guide {
BertModelExecutor::BertModelExecutor(
proto::OptimizationTarget optimization_target)
: … { … }
BertModelExecutor::~BertModelExecutor() = default;
std::optional<std::vector<tflite::task::core::Category>>
BertModelExecutor::Execute(ModelExecutionTask* execution_task,
ExecutionStatus* out_status,
const std::string& input) { … }
base::expected<std::unique_ptr<BertModelExecutor::ModelExecutionTask>,
ExecutionStatus>
BertModelExecutor::BuildModelExecutionTask(base::MemoryMappedFile* model_file) { … }
}