@@ -37,41 +37,12 @@ class LlavaRunner : public MultimodalRunner {
37
37
std::function<void (const std::string&)> token_callback = {},
38
38
std::function<void (const ::executorch::extension::llm::Stats&)>
39
39
stats_callback = {});
40
-
41
- /* *
42
- * Prefill an LLaVA Module with the given images input.
43
- * @param images The image input to LLaVA.
44
- * @param start_pos The starting position in KV cache of the input in the LLM.
45
- * It's passed as reference and will be updated inside this function.
46
- * @return The error status of prefilling images.
47
- */
48
40
Error prefill_images (std::vector<Image>& images, int64_t & start_pos);
49
-
50
- /* *
51
- * Prefill an LLaVA Module with the given text input.
52
- * @param prompt The text prompt to LLaVA.
53
- * @param start_pos The starting position in KV cache of the input in the LLM.
54
- * It's passed as reference and will be updated inside this function.
55
- * @param bos The number of BOS (begin of sequence) token.
56
- * @param eos The number of EOS (end of sequence) token.
57
- * @return The generated token of the LLaVA Module after prefill prompt.
58
- */
59
41
Result<uint64_t > prefill_prompt (
60
42
const std::string& prompt,
61
43
int64_t & start_pos,
62
44
int8_t bos = 0 ,
63
45
int8_t eos = 0 );
64
-
65
- /* *
66
- * Generate tokens from the given prompt, starting from the given position.
67
- * @param prompt The text prompt to LLaVA.
68
- * @param seq_len The total sequence length, including the prompt tokens and
69
- * new tokens.
70
- * @param start_pos The starting position in KV cache of the input in the LLM.
71
- * @param token_callback What to do after a token is generated.
72
- * @param stats_callback What to do with Stats.
73
- * @return The error code.
74
- */
75
46
Error generate_from_pos (
76
47
const std::string& prompt,
77
48
int32_t seq_len = 1024 ,
0 commit comments