Skip to content

Commit 3247c15

Browse files
authored
Revert "[multimodal] Allow generate and prefill to take move sematics" (#15000)
Reverts #14643
1 parent 896178e commit 3247c15

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

extension/llm/runner/multimodal_runner.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ Error MultimodalRunner::load() {
6262
ET_LOG(Info, format, __VA_ARGS__); \
6363
}
6464

65-
Error MultimodalRunner::prefill(std::vector<MultimodalInput>&& inputs) {
66-
// Forward to the const reference version
67-
return prefill(inputs);
68-
}
69-
7065
Error MultimodalRunner::prefill(const std::vector<MultimodalInput>& inputs) {
7166
if (!is_loaded()) {
7267
ET_CHECK_OK_OR_RETURN_ERROR(load());
@@ -77,16 +72,6 @@ Error MultimodalRunner::prefill(const std::vector<MultimodalInput>& inputs) {
7772
return Error::Ok;
7873
}
7974

80-
Error MultimodalRunner::generate(
81-
std::vector<MultimodalInput>&& inputs,
82-
const GenerationConfig& config,
83-
std::function<void(const std::string&)> token_callback,
84-
std::function<void(const Stats&)> stats_callback) {
85-
// Forward to the const reference version
86-
return generate(
87-
inputs, config, std::move(token_callback), std::move(stats_callback));
88-
}
89-
9075
Error MultimodalRunner::generate(
9176
const std::vector<MultimodalInput>& inputs,
9277
const GenerationConfig& config,

extension/llm/runner/multimodal_runner.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,6 @@ class ET_EXPERIMENTAL MultimodalRunner {
119119
std::function<void(const std::string&)> token_callback = {},
120120
std::function<void(const Stats&)> stats_callback = {});
121121

122-
/**
123-
* Generate tokens from multimodal inputs with move semantics.
124-
* This overload allows efficient transfer of temporary vectors.
125-
* @param inputs A vector of MultimodalInput objects (moved).
126-
* @param config Generation configuration parameters.
127-
* @param token_callback Callback function called for each generated token.
128-
* @param stats_callback Callback function for generation statistics.
129-
* @return The error code. KV cache position is tracked internally in pos_.
130-
*/
131-
virtual ::executorch::runtime::Error generate(
132-
std::vector<MultimodalInput>&& inputs,
133-
const GenerationConfig& config,
134-
std::function<void(const std::string&)> token_callback = {},
135-
std::function<void(const Stats&)> stats_callback = {});
136-
137122
/**
138123
* Prefill multimodal inputs, for example to reload chat history.
139124
* @param inputs A vector of MultimodalInput objects containing images and
@@ -143,15 +128,6 @@ class ET_EXPERIMENTAL MultimodalRunner {
143128
virtual ::executorch::runtime::Error prefill(
144129
const std::vector<MultimodalInput>& inputs);
145130

146-
/**
147-
* Prefill multimodal inputs with move semantics.
148-
* This overload allows efficient transfer of temporary vectors.
149-
* @param inputs A vector of MultimodalInput objects (moved).
150-
* @return The error code. KV cache position is tracked internally in pos_.
151-
*/
152-
virtual ::executorch::runtime::Error prefill(
153-
std::vector<MultimodalInput>&& inputs);
154-
155131
inline void stop() {
156132
text_token_generator_->stop();
157133
}

0 commit comments

Comments
 (0)