nndeploy C++ API  0.2.0
nndeploy C++ API
llm_out.h
Go to the documentation of this file.
1 
2 #ifndef _NNDEPLOY_LLM_LLM_OUT_H_
3 #define _NNDEPLOY_LLM_LLM_OUT_H_
4 
5 #include "nndeploy/base/any.h"
6 #include "nndeploy/base/common.h"
8 #include "nndeploy/base/log.h"
9 #include "nndeploy/base/macro.h"
10 #include "nndeploy/base/object.h"
12 #include "nndeploy/base/param.h"
13 #include "nndeploy/base/status.h"
14 #include "nndeploy/base/string.h"
16 #include "nndeploy/dag/edge.h"
17 #include "nndeploy/dag/graph.h"
18 #include "nndeploy/dag/loop.h"
19 #include "nndeploy/dag/node.h"
20 #include "nndeploy/device/buffer.h"
21 #include "nndeploy/device/device.h"
23 #include "nndeploy/tokenizer/tokenizer_cpp/tokenizer_cpp.h"
24 
25 namespace nndeploy {
26 namespace llm {
27 
29  public:
30  LlmOut(const std::string& name, std::vector<dag::Edge*> inputs,
31  std::vector<dag::Edge*> outputs)
32  : Node(name, inputs, outputs) {
33  key_ = "nndeploy::llm::LlmOut";
34  desc_ = "Print TokenizerText content and save to temporary output file.";
35  this->setInputTypeInfo<tokenizer::TokenizerText>();
36  node_type_ = dag::NodeType::kNodeTypeOutput;
37  this->setIoType(dag::IOType::kIOTypeText);
38  }
39  virtual ~LlmOut() {}
40  virtual base::Status run();
41 
42  virtual base::Status serialize(rapidjson::Value& json,
43  rapidjson::Document::AllocatorType& allocator);
44  virtual base::Status deserialize(rapidjson::Value& json);
45 
46  void set_path(std::string path) { path_ = path; }
47 
48  private:
49  std::string path_ = "resources/others/llm_out.txt";
50 };
51 
52 } // namespace llm
53 } // namespace nndeploy
54 
55 #endif // _NNDEPLOY_LLM_LLM_OUT_H_
Node base class.
Definition: node.h:171
virtual base::Status run()
Run node (pure virtual function)
virtual base::Status deserialize(rapidjson::Value &json)
Deserialize from JSON.
LlmOut(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
Definition: llm_out.h:30
virtual ~LlmOut()
Definition: llm_out.h:39
virtual base::Status serialize(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator)
Serialize to JSON.
void set_path(std::string path)
Definition: llm_out.h:46
#define NNDEPLOY_CC_API
api
Definition: macro.h:29