调整数据格式bug
This commit is contained in:
parent
a5fd61fd25
commit
150ec134b2
@ -15,7 +15,10 @@ def load_dialogue_data(file_path: str) -> List[Dict]:
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
data = json.loads(line.strip())
|
||||
dialogues.append(data)
|
||||
if data and isinstance(data, dict) and 'role' in data:
|
||||
dialogues.append(data)
|
||||
else:
|
||||
pass
|
||||
return dialogues
|
||||
|
||||
def get_dialogue_characters(dialogues: List[Dict]) -> List[str]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user