27 #ifndef _NNDEPLOY_LLM_EMBEDDING_H_
28 #define _NNDEPLOY_LLM_EMBEDDING_H_
49 #include "nndeploy/llm/embedding/diskembedding.hpp"
67 int hidden_size_ = 4096;
69 std::
string embedding_weight_path_ = "";
71 bool use_quantization_ = false;
73 int weight_offset_ = 0;
85 std::
string share_disk_embedding_key_ = "disk_embedding";
87 std::
string getShareKey() {
89 key += embedding_weight_path_;
90 key += std::to_string(hidden_size_);
93 key += std::to_string(use_quantization_);
94 key += std::to_string(weight_offset_);
95 key += std::to_string(a_offset_);
96 key += std::to_string(alpha_size_);
97 key += std::to_string(quant_bit_);
102 rapidjson::Value& json,
103 rapidjson::Document::AllocatorType& allocator)
override;
122 Embedding(
const std::string& name, std::vector<dag::Edge*> inputs,
123 std::vector<dag::Edge*> outputs);
132 std::shared_ptr<MNN::Transformer::DiskEmbedding> disk_embedding_ =
nullptr;
virtual base::Status deserialize(rapidjson::Value &json)
virtual std::string serialize()
EmbeddingParam - Embedding节点的参数配置
virtual ~EmbeddingParam()=default
virtual base::Status serialize(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) override
virtual base::Status deserialize(rapidjson::Value &json) override
virtual base::Status run()
Run node (pure virtual function)
virtual base::Status deinit()
Deinitialize node.
virtual base::Status init()
Initialize node.
Embedding(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
#define NNDEPLOY_CC_API
api
std::string dataFormatToString(DataFormat data_format)
std::string dataTypeToString(DataType data_type)
#define PARAM_COPY_TO(param_type)
#define PARAM_COPY(param_type)