mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00

* add calm dataset * modify config max_out_len * update README * Modify README * update README * update README * update README * update README * update README * add summarizer and modify readme * delete summarizer config comment * update summarizer * modify same response to all questions * update README
18 lines
483 B
Python
18 lines
483 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
def load_query_instances(path):
|
|
"""
|
|
Loads query instances from a JSON file.
|
|
|
|
Args:
|
|
path (str or Path): The path to the JSON file.
|
|
|
|
Returns:
|
|
list: A list of query instances loaded from the JSON file.
|
|
"""
|
|
if isinstance(path, str):
|
|
path = Path(path)
|
|
with path.open("r", encoding="utf-8") as f:
|
|
item_list = [json.loads(line) for line in f.readlines()]
|
|
return item_list |