10 #ifndef _NNDEPLOY_LLM_LLM_INFER_H_
11 #define _NNDEPLOY_LLM_LLM_INFER_H_
49 LlmInfer(
const std::string& name, std::vector<dag::Edge*> inputs,
50 std::vector<dag::Edge*> outputs);
64 rapidjson::Value& json,
65 rapidjson::Document::AllocatorType& allocator)
override;
70 std::vector<dag::Edge*> outputs,
71 const std::string& infer_key,
72 const std::string& model_key,
76 bool is_prefill_ =
true;
78 std::vector<std::string> config_path_;
80 std::string model_key_ =
"Qwen";
82 std::string infer_key_ =
"DefaultLlmInfer";
87 std::vector<std::string> model_inputs_ = {
"input_ids",
"attention_mask",
88 "position_ids",
"past_key_values"};
90 std::vector<std::string> model_outputs_ = {
"logits",
"presents"};
Composite node Composite node is a special type of node in nndeploy that enhances the capabilities of...
virtual base::Status deserialize(rapidjson::Value &json)
Deserialize from JSON.
virtual std::string serialize()
Serialize to JSON string.
Edge class in DAG graph for connecting nodes and transferring data.
virtual base::Status run()
Run node (pure virtual function)
virtual base::Status init()
Initialize node.
virtual int getMaxSeqLen()
llm::AbstractLlmInfer * createLlmInfer(std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs, const std::string &infer_key, const std::string &model_key, bool is_prefill)
virtual base::Status serialize(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) override
Serialize to JSON.
virtual base::Status setPrefill(bool is_prefill)
LlmInfer(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
virtual base::Status deserialize(rapidjson::Value &json) override
Deserialize from JSON.
virtual base::Status deinit()
Deinitialize node.
virtual base::Status setIterInput(dag::Edge *input, int index)
Set iteration input edge.
#define NNDEPLOY_CC_API
api