Skip to content

Qualcomm AI Engine Direct - Update the evaluator API call for Llama #6386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions extension/llm/export/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ def pt2e_calibrate(
from executorch.examples.models.llama.eval_llama_lib import (
GraphModuleEvalWrapper,
)
from executorch.examples.models.llama.evaluate import ( # pyre-ignore[21]
evaluate_model,
)
from lm_eval.evaluator import simple_evaluate # pyre-ignore[21]
except ImportError:
raise ImportError(
"Please install the llm eval dependency via examples/models/llama/install_requirements.sh"
Expand Down Expand Up @@ -266,11 +264,14 @@ def calibrate_template(
generate_full_logits=self.generate_full_logits,
enable_dynamic_shape=self.enable_dynamic_shape,
)
eval_results = evaluate_model(
eval_wrapper,
calibration_tasks,
calibration_limit,
)

# Evaluate the model
with torch.no_grad():
eval_results = simple_evaluate(
model=eval_wrapper,
tasks=calibration_tasks,
limit=calibration_limit,
)

for task, res in eval_results["results"].items():
print(f"{task}: {res}")
Expand Down
Loading