File size: 355 Bytes
499b1cd
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import json

def load_jsonl(file_path) -> list[dict]:
    result = []
    with open(file_path, 'r', encoding='utf-8') as file:
        for line in file:
            if not line.strip() or line.startswith('#') or line.startswith('//'):
                continue
            json_line = json.loads(line)
            result.append(json_line)
    return result