Skip to content
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

update eval and fix example #260

Merged
merged 5 commits into from
Sep 14, 2024
Merged

update eval and fix example #260

merged 5 commits into from
Sep 14, 2024

Conversation

n1ck-guo
Copy link
Contributor

No description provided.

Signed-off-by: n1ck-guo <[email protected]>
model_args = f"pretrained={args.model},trust_remote_code={not args.disable_trust_remote_code}"
if isinstance(args.tasks, str):
tasks = args.tasks.split(',')
res = simple_evaluate(
model="hf",
model_args=model_args,
user_model=user_model,
Copy link
Contributor

@wenhuach21 wenhuach21 Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if "opt" in model_name:
    seqlen = model.config.max_position_embeddings
    model.seqlen = model.config.max_position_embeddings
else:
    seqlen = 2048
    model.seqlen = seqlen
seqlen = args.seqlen

remove 'model.seqlen = seqlen' this setting, this is only for ppl evaluation without using lm-eval model.seqlen = seqlen

device_str = detect_device(args.device)
user_model = AutoModelForCausalLM.from_pretrained(
args.model,
device_map=device_str, quantization_config=quantization_config)
model_args = f"pretrained={args.model},trust_remote_code={not args.disable_trust_remote_code}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reformat this file, there are many extra lines between codes

Signed-off-by: n1ck-guo <[email protected]>

model = model.eval()
# align with GPTQ to eval ppl
seqlen = args.seqlen
if "opt" in model_name:
seqlen = model.config.max_position_embeddings
model.seqlen = model.config.max_position_embeddings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@wenhuach21 wenhuach21 self-requested a review September 14, 2024 10:11
@wenhuach21 wenhuach21 merged commit 7816eea into main Sep 14, 2024
10 checks passed
@wenhuach21 wenhuach21 deleted the hengguo/update_eval branch September 14, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants