MCPcopy Create free account
hub / github.com/alibaba/MNN / ProcessPrompt

Method ProcessPrompt

apps/mnncli/src/model_runner.cpp:111–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111int ModelRunner::ProcessPrompt(const std::string& prompt, std::ostream* output, int max_new_tokens) {
112 if (output == nullptr) {
113 output = &std::cout;
114 }
115
116#ifdef LLM_SUPPORT_VISION
117#ifndef OPENCV_NOT_AVAILABLE
118 // Check if prompt contains video tags
119 std::regex video_regex("<video>(.*?)</video>");
120 std::smatch match;
121 if (std::regex_search(prompt, match, video_regex)) {
122 return ProcessVideoPrompt(prompt, output);
123 }
124#endif
125#endif
126 llm_->response(prompt, output, nullptr, max_new_tokens);
127 return 0;
128}
129
130#ifdef LLM_SUPPORT_VISION
131#ifndef OPENCV_NOT_AVAILABLE

Callers 1

mainFunction · 0.80

Calls 1

responseMethod · 0.45

Tested by

no test coverage detected