in 3_optimization-design-ptn/03_prompt-optimization/promptwizard/glue/paramlogger/file_utils.py [0:0]
def read_jsonl_row(file_path: str):
"""
:param file_path:
:return: Single line from the file. One at a time.
"""
with open(file_path, "r") as fileobj:
while True:
single_row = fileobj.readline()
if not single_row:
break
json_object = json.loads(single_row.strip())
yield json_object