File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -569,12 +569,9 @@ def _load_llama_model_metadata(
569
569
):
570
570
is_fairseq2 = weight_type == WeightType .FAIRSEQ2
571
571
metadata = {
572
- "append_eos_to_prompt" : is_fairseq2 , # For language llama, tell the runtime to always append EOS token(s) to prompt.
573
572
"get_bos_id" : 3 if is_fairseq2 else 1 ,
574
573
"get_eos_ids" : [3 ] if is_fairseq2 else [2 ],
575
574
"get_max_seq_len" : model_args .max_seq_len ,
576
- "get_n_bos" : 1 ,
577
- "get_n_eos" : 2 if is_fairseq2 else 1 ,
578
575
"get_vocab_size" : model_args .vocab_size ,
579
576
"use_kv_cache" : use_kv_cache ,
580
577
"use_sdpa_with_kv_cache" : use_sdpa_with_kv_cache ,
Original file line number Diff line number Diff line change 24
24
25
25
namespace torch ::executor {
26
26
namespace {
27
- static constexpr auto kAppendEosToPrompt = " append_eos_to_prompt" ;
28
27
static constexpr auto kEnableDynamicShape = " enable_dynamic_shape" ;
29
28
static constexpr auto kBosId = " get_bos_id" ;
30
29
static constexpr auto kEosIds = " get_eos_ids" ;
31
30
static constexpr auto kMaxSeqLen = " get_max_seq_len" ;
32
- static constexpr auto kNBos = " get_n_bos" ;
33
- static constexpr auto kNEos = " get_n_eos" ;
34
31
static constexpr auto kVocabSize = " get_vocab_size" ;
35
32
static constexpr auto kUseKVCache = " use_kv_cache" ;
36
33
static constexpr auto kUseSDPAWithKVCache = " use_sdpa_with_kv_cache" ;
@@ -54,11 +51,8 @@ Runner::Runner(
54
51
#endif
55
52
),
56
53
metadata_({
57
- {kAppendEosToPrompt , false },
58
54
{kEnableDynamicShape , false },
59
55
{kMaxSeqLen , 128 },
60
- {kNBos , 1 },
61
- {kNEos , 1 },
62
56
{kUseKVCache , true },
63
57
{kUseSDPAWithKVCache , false },
64
58
}) {
@@ -174,8 +168,8 @@ Error Runner::generate(
174
168
175
169
Result<std::vector<uint64_t >> encode_res = tokenizer_->encode (
176
170
prompt,
177
- metadata_. at ( kNBos ) ,
178
- metadata_. at ( kAppendEosToPrompt ) ? metadata_. at ( kNEos ) : 0 );
171
+ /* bos */ 0 ,
172
+ /* eos */ 0 );
179
173
180
174
ET_CHECK_OK_OR_RETURN_ERROR (
181
175
encode_res.error (), " Failed to encode prompt %s" , prompt.c_str ());
You can’t perform that action at this time.
0 commit comments