Skip to content

Commit 7f26d31

Browse files
committed
Qualcomm AI Engine Direct - Update the evaluator API call for Llama
1 parent ad0e5e8 commit 7f26d31

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

extension/llm/export/builder.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ def pt2e_calibrate(
219219
from executorch.examples.models.llama.eval_llama_lib import (
220220
GraphModuleEvalWrapper,
221221
)
222-
from executorch.examples.models.llama.evaluate import ( # pyre-ignore[21]
223-
evaluate_model,
224-
)
222+
from lm_eval.evaluator import simple_evaluate # pyre-ignore[21]
225223
except ImportError:
226224
raise ImportError(
227225
"Please install the llm eval dependency via examples/models/llama/install_requirements.sh"
@@ -266,11 +264,14 @@ def calibrate_template(
266264
generate_full_logits=self.generate_full_logits,
267265
enable_dynamic_shape=self.enable_dynamic_shape,
268266
)
269-
eval_results = evaluate_model(
270-
eval_wrapper,
271-
calibration_tasks,
272-
calibration_limit,
273-
)
267+
268+
# Evaluate the model
269+
with torch.no_grad():
270+
eval_results = simple_evaluate(
271+
model=eval_wrapper,
272+
tasks=calibration_tasks,
273+
limit=calibration_limit,
274+
)
274275

275276
for task, res in eval_results["results"].items():
276277
print(f"{task}: {res}")

0 commit comments

Comments
 (0)