Skip to content

Commit

Permalink
Fix llava_wilder bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kcz358 committed Jul 8, 2024
1 parent a4d59de commit 266bc70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lmms_eval/tasks/llava_wilder/llava_wilder_small.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dataset_path: lmms-lab/llava-bench-wilder
dataset_path: lmms-lab/LLaVA-Bench-Wilder
dataset_kwargs:
token: True
task: "llava_wilder_small"
test_split: small
test_split: test
model_specific_prompt_kwargs:
default:
pre_prompt: ""
post_prompt: ""
xcomposer2_4khd:
pre_prompt: "[UNUSED_TOKEN_146]user\nQuestion: "
post_prompt: "[UNUSED_TOKEN_145]\n[UNUSED_TOKEN_146]assistant\n"
include: _default_template_wilder_yaml
include: _default_template_wilder_yaml
6 changes: 3 additions & 3 deletions lmms_eval/tasks/llava_wilder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def llava_process_results(doc, result):
a dictionary with key: metric name (in this case coco_bleu), value: metric value
"""
try:
question = doc.get("question", "")
ans1 = doc.get("answer", "")
question = doc.get("Question", "")
ans1 = doc.get("Answer", "")
ans2 = result[0] if result else ""
content = f"[Question]\n{question}\n\n" + f"[Assistant 1]\n{ans1}\n\n[End of Assistant 1]\n\n" + f"[Assistant 2]\n{ans2}\n\n[End of Assistant 2]\n\n" f"[System]\n{judge_rules}\n\n"
visuals = llava_doc_to_visual(doc)
Expand Down Expand Up @@ -148,7 +148,7 @@ def llava_doc_to_text(doc, model_specific_prompt_kwargs=None):
model_specific_prompt_kwargs = {}
pre_prompt = model_specific_prompt_kwargs.get("pre_prompt", "")
post_prompt = model_specific_prompt_kwargs.get("post_prompt", "")
return f"{pre_prompt}{doc['question']}{post_prompt}"
return f"{pre_prompt}{doc['Question']}{post_prompt}"


def llava_all_aggregation(results):
Expand Down

0 comments on commit 266bc70

Please sign in to comment.