解决数据bug
This commit is contained in:
parent
1b5c8d64b0
commit
9d081893aa
@ -50,7 +50,8 @@ def create_character_dialogue_samples(character:str, dialogues: List[Dict]) ->Li
|
||||
tempDialogue = dialogue['dialogue']
|
||||
elif tempDialogue != '':
|
||||
#确定是提问对话
|
||||
character_samples.append({"instruction": tempDialogue,
|
||||
character_samples.append({"character": character,
|
||||
"instruction": tempDialogue,
|
||||
"input": "",
|
||||
"output": dialogue['dialogue']})
|
||||
tempDialogue = ''
|
||||
@ -65,9 +66,9 @@ def main():
|
||||
for char, convs in character_dialogues.items():
|
||||
print(f" {char}: {len(convs)}条对话")
|
||||
#获得最终训练数据
|
||||
final_samples = {}
|
||||
final_samples = []
|
||||
for character in characters:
|
||||
final_samples[character] = create_character_dialogue_samples(character, dialogues)
|
||||
final_samples += create_character_dialogue_samples(character, dialogues)
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user