Skip to content

Commit f3a8f09

Browse files
committed
Gracefully handle new release of lm_eval
1 parent b9c975f commit f3a8f09

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

olive/evaluator/lmeval_ort.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
import torch.nn.functional as F
1414
from lm_eval.api.model import TemplateLM
1515
from lm_eval.api.registry import register_model
16-
from lm_eval.models.utils import Collator, pad_and_concat
16+
from lm_eval.models.utils import Collator
1717
from tqdm import tqdm
1818
from transformers import AutoConfig, AutoTokenizer
1919

20+
try:
21+
from lm_eval.models.utils_hf import pad_and_concat # pylint: disable=ungrouped-imports
22+
except ImportError:
23+
from lm_eval.models.utils import pad_and_concat
24+
2025
from olive.common.onnx_io import get_io_config, get_io_dtypes, get_kv_info
2126
from olive.common.utils import cleanup_memory
2227

0 commit comments

Comments
 (0)