MCPcopy Create free account
hub / github.com/MiuLab/Taiwan-LLM / load_model_answer

Function load_model_answer

evaluation/llm_eval.py:76–86  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

74
75
76def load_model_answer(path: str) -> dict[str, str]:
77 df = pd.read_json(path, lines=True)
78 if "question_id" in df.columns and "choices" in df.columns:
79 return {
80 row["question_id"]: row["choices"][0]["turns"][0]
81 for _, row in df.iterrows()
82 }
83 elif "id" in df.columns and "generated_text" in df.columns:
84 return {int(row["id"])+1: row["generated_text"] for _, row in df.iterrows()}
85 else:
86 raise ValueError("Unknown format")
87
88
89

Callers 1

llm_eval.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected