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() {
65
65
Error MultimodalRunner::generate (
66
66
const std::vector<MultimodalInput>& inputs,
67
67
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) {
70
70
if (inputs.empty ()) {
71
71
ET_LOG (Error, " MultimodalInput vector cannot be empty" );
72
72
return Error::InvalidArgument;
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ class ET_EXPERIMENTAL MultimodalRunner {
116
116
virtual ::executorch::runtime::Error generate (
117
117
const std::vector<MultimodalInput>& inputs,
118
118
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 = {} );
121
121
122
122
inline void stop () {
123
123
text_token_generator_->stop ();
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ class ET_EXPERIMENTAL TextTokenGenerator {
36
36
37
37
/* *
38
38
* 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
42
42
* prompt tokens is prefilled.
43
43
* @param max_new_tokens Maximum number of new tokens to generate.
44
44
* @param temperature controls the randomness of predictions by scaling the
You can’t perform that action at this time.
0 commit comments