调整数据格式bug

This commit is contained in:
997146918 2025-08-09 08:18:18 +08:00
parent a5fd61fd25
commit 150ec134b2

View File

@ -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())
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]: