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(
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 } " )
You can’t perform that action at this time.
0 commit comments