File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ Error MultimodalRunner::load() {
6565Error MultimodalRunner::generate (
6666 const std::vector<MultimodalInput>& inputs,
6767 const GenerationConfig& config,
68- std::function<void (const std::string&)>& token_callback,
69- std::function<void(const Stats&)>& stats_callback) {
68+ std::function<void (const std::string&)> token_callback,
69+ std::function<void(const Stats&)> stats_callback) {
7070 if (inputs.empty ()) {
7171 ET_LOG (Error, " MultimodalInput vector cannot be empty" );
7272 return Error::InvalidArgument;
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ class ET_EXPERIMENTAL MultimodalRunner {
116116 virtual ::executorch::runtime::Error generate (
117117 const std::vector<MultimodalInput>& inputs,
118118 const GenerationConfig& config,
119- std::function<void (const std::string&)>& token_callback,
120- std::function<void(const Stats&)>& stats_callback);
119+ std::function<void (const std::string&)> token_callback = {} ,
120+ std::function<void (const Stats&)> stats_callback = {} );
121121
122122 inline void stop () {
123123 text_token_generator_->stop ();
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ class ET_EXPERIMENTAL TextTokenGenerator {
3636
3737 /* *
3838 * Token generation loop.
39- * @param tokens prompt tokens as well as the first token generated by
40- * prefill.
41- * @param start_pos the start position of the new tokens, based on how many
39+ * @param tokens The first token generated by prefill, if using kv cache. Else
40+ * the prompt tokens + the first token generated by prefill.
41+ * @param start_pos The start position of the new tokens, based on how many
4242 * prompt tokens is prefilled.
4343 * @param max_new_tokens Maximum number of new tokens to generate.
4444 * @param temperature controls the randomness of predictions by scaling the
You can’t perform that action at this time.
0 commit comments