Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit c916ee0

Browse files
authored
fix not define unwrapped_model. (#841)
1 parent 4212741 commit c916ee0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

intel_extension_for_transformers/llm/finetuning/finetuning.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ class Eval_Args:
598598
self.logger.info(results)
599599

600600
elif finetune_args.do_lm_eval and finetune_args.task != "summarization":
601+
unwrapped_model = unwrap_model(model)
601602
unwrapped_model.eval()
602603
from intel_extension_for_transformers.llm.evaluation.lm_eval import evaluate
603604
with training_args.main_process_first(desc="lm_eval"):
@@ -615,6 +616,8 @@ class Eval_Args:
615616
self.logger.info(results)
616617

617618
if finetune_args.task == "summarization":
619+
unwrapped_model = unwrap_model(model)
620+
unwrapped_model.eval()
618621
from .eval_utils import compute_rouge_metric
619622
gen_kwargs = {
620623
"num_beams": data_args.num_beams,

0 commit comments

Comments
 (0)