disentangle model from tuner and rename modules

This commit is contained in:
hiyouga
2023-11-15 16:29:09 +08:00
parent 2f02f688e1
commit 4736344eb1
57 changed files with 324 additions and 263 deletions

View File

@@ -0,0 +1,7 @@
import numpy as np
from typing import Dict, Sequence, Tuple, Union
def compute_accuracy(eval_preds: Sequence[Union[np.ndarray, Tuple[np.ndarray]]]) -> Dict[str, float]:
preds, _ = eval_preds
return {"accuracy": (preds[0] > preds[1]).sum() / len(preds[0])}