File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -219,9 +219,7 @@ def pt2e_calibrate(
219
219
from executorch .examples .models .llama .eval_llama_lib import (
220
220
GraphModuleEvalWrapper ,
221
221
)
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]
225
223
except ImportError :
226
224
raise ImportError (
227
225
"Please install the llm eval dependency via examples/models/llama/install_requirements.sh"
@@ -266,11 +264,14 @@ def calibrate_template(
266
264
generate_full_logits = self .generate_full_logits ,
267
265
enable_dynamic_shape = self .enable_dynamic_shape ,
268
266
)
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
+ )
274
275
275
276
for task , res in eval_results ["results" ].items ():
276
277
print (f"{ task } : { res } " )
You can’t perform that action at this time.
0 commit comments