[GLM4.1V and GLM4.5V] Add vision transformer num_dummy_head support: max tp=4 -> max tp=8 (#9059)

This commit is contained in:
Binyao Jiang
2025-08-18 14:40:13 -07:00
committed by GitHub
parent 98b44e9e56
commit c2fbf60f39
9 changed files with 150 additions and 102 deletions

View File

@@ -141,9 +141,13 @@ def eval_mmmu(args):
print(f"response: {response}")
process_result(response, sample, answer_dict, out_samples)
args.output_path = f"{args.model_path}_val_hf.json"
args.output_path = f"{args.model_path}_answer_hf.json"
save_json(args.output_path, out_samples)
eval_result(model_answer_path=args.output_path, answer_dict=answer_dict)
eval_result(
model_answer_path=args.output_path,
answer_dict=answer_dict,
eval_output_path=f"{args.model_path}_val_hf.json",
)
if __name__ == "__main__":

View File

@@ -187,9 +187,13 @@ async def eval_mmmu(args) -> None:
print("Profiler stopped")
print(f"Benchmark time: {time.perf_counter() - start}")
args.output_path = f"./val_sglang.json"
args.output_path = "./answer_sglang.json"
save_json(args.output_path, out_samples)
eval_result(model_answer_path=args.output_path, answer_dict=answer_dict)
eval_result(
model_answer_path=args.output_path,
answer_dict=answer_dict,
eval_output_path="./val_sglang.json",
)
def parse_args():

View File

@@ -544,7 +544,9 @@ def process_result(response, sample, answer_dict, out_samples):
}
def eval_result(model_answer_path, answer_dict):
def eval_result(model_answer_path, answer_dict, eval_output_path=None):
if eval_output_path is None:
eval_output_path = model_answer_path
print("Evaluating...")
output_dict = json.load(open(model_answer_path))
# answer_dict = json.load(open(answer_path))
@@ -639,7 +641,7 @@ def eval_result(model_answer_path, answer_dict):
"acc": overall_acc,
}
pprint.pprint(printable_results)
out = model_answer_path
out = eval_output_path
with open(out, "w", encoding="utf-8") as outfile:
json.dump(printable_results, outfile)
print(f"eval out saved to {out}")