File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -223,9 +223,9 @@ def __iter__(
223
223
output_tokens_sampler ,
224
224
):
225
225
start_index = rand .randint (0 , len (self .text_creator .words ))
226
- prefix_tokens = next (shared_prefix_iter , [])
227
226
# Append the prefix tokens only for the first turn
228
227
if i == 0 :
228
+ prefix_tokens = next (shared_prefix_iter , [])
229
229
prompt_text = self .processor .decode (
230
230
prefix_tokens
231
231
+ self ._create_prompt (
@@ -234,7 +234,9 @@ def __iter__(
234
234
skip_special_tokens = True ,
235
235
)
236
236
row ["prompt" ].append (prompt_text )
237
- row ["prompt_tokens_count" ].append (len (prefix_tokens ) + prompt_tokens )
237
+ row ["prompt_tokens_count" ].append (
238
+ len (prefix_tokens ) + prompt_tokens
239
+ )
238
240
row ["output_tokens_count" ].append (output_tokens )
239
241
else :
240
242
prompt_text = self .processor .decode (
You can’t perform that action at this time.
0 commit comments