fix template
This commit is contained in:
parent
d86ea314a1
commit
ac29f4d5f0
|
@ -97,10 +97,10 @@ class Template:
|
|||
sep_ids = self._convert_inputs_to_ids(tokenizer, context=self.sep)
|
||||
encoded_pairs = []
|
||||
for turn_idx, (query, resp) in enumerate(history):
|
||||
if turn_idx == 0 and prefix:
|
||||
prefix_ids = self._convert_inputs_to_ids(tokenizer, context=prefix) + eos_ids + sep_ids
|
||||
else:
|
||||
if turn_idx != 0:
|
||||
prefix_ids = sep_ids
|
||||
elif prefix:
|
||||
prefix_ids = self._convert_inputs_to_ids(tokenizer, context=prefix) + eos_ids + sep_ids
|
||||
query_ids = self._convert_inputs_to_ids(tokenizer, context=self.prompt, query=query)
|
||||
resp_ids = self._convert_inputs_to_ids(tokenizer, context=[resp])
|
||||
encoded_pairs.append((bos_ids + prefix_ids + query_ids, resp_ids + eos_ids))
|
||||
|
|
Loading…
Reference in New Issue