-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* reformat mix eval * video2text fix * video * Add image-to-text evaluation tasks and templates * Refactor image-to-text evaluation tasks and update configurations * Enhance LlamaVision model with video loading improvements and configuration updates * fix internvl2 * llava vid default numframe too small * add max_new_tokens * remove "with a short phrase" for `gpt4v`
- Loading branch information
Showing
25 changed files
with
1,036 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import os | ||
import re | ||
import sys | ||
import unicodedata | ||
|
||
import openai | ||
|
||
from lmms_eval.api.filter import Filter | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lmms_eval/tasks/mix_evals/audio2text/mix_evals_audio2text.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
group: mix_evals_audio2text | ||
task: | ||
- mix_evals_audio2_text_freeform |
13 changes: 13 additions & 0 deletions
13
lmms_eval/tasks/mix_evals/image2text/_default_template_yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dataset_path: MixEval/MixEval-X | ||
dataset_kwargs: | ||
video: true # a bit confusing, but this is because the official uses path to store image data, so we need to load it as a video dataset | ||
cache_dir: mix_evals_image2text | ||
lmms_eval_specific_kwargs: | ||
default: | ||
post_prompt: "" | ||
pre_prompt: "" | ||
gpt4v: | ||
post_prompt: "" | ||
pre_prompt: "" | ||
metadata: | ||
version: 0 |
4 changes: 4 additions & 0 deletions
4
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
group: mix_evals_image2text | ||
task: | ||
- mix_evals_image2text_mc | ||
- mix_evals_image2text_freeform |
17 changes: 17 additions & 0 deletions
17
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_freeform.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
task: "mix_evals_image2text_freeform" | ||
dataset_name: "image2text" | ||
test_split: free_form | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
process_results: !function utils.mix_evals_image2text_process_results_freeform | ||
metric_list: | ||
- metric: gpt_eval | ||
aggregation: !function utils.mix_evals_image2text_gpt_eval | ||
higher_is_better: true | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
include: _default_template_yaml |
25 changes: 25 additions & 0 deletions
25
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_freeform_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
task: "mix_evals_image2text_freeform_hard" | ||
dataset_name: "image2text" | ||
test_split: free_form_hard | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
process_results: !function utils.mix_evals_image2text_process_results_freeform | ||
metric_list: | ||
- metric: gpt_eval | ||
aggregation: !function utils.mix_evals_image2text_gpt_eval | ||
higher_is_better: true | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
include: _default_template_yaml | ||
|
||
lmms_eval_specific_kwargs: | ||
default: | ||
pre_prompt: "Please answer the following questions about the image." | ||
post_prompt: "" | ||
gpt4v: | ||
pre_prompt: "Please answer the following questions about the image." | ||
post_prompt: "" |
5 changes: 5 additions & 0 deletions
5
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
group: mix_evals_image2text_hard | ||
task: | ||
- mix_evals_image2text_mc_hard | ||
- mix_evals_image2text_freeform_hard | ||
# - mix_evals_image2text_openended |
23 changes: 23 additions & 0 deletions
23
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_mc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include: _default_template_yaml | ||
task: "mix_evals_image2text_mc" | ||
dataset_name: "image2text" | ||
test_split: multiple_choice | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
metric_list: | ||
- metric: exact_match | ||
aggregation: mean | ||
higher_is_better: true | ||
ignore_case: true | ||
ignore_punctuation: true | ||
|
||
filter_list: | ||
- name: "flexible-extract" | ||
filter: | ||
- function: !function utils.GPTMultiChoiceFilter |
23 changes: 23 additions & 0 deletions
23
lmms_eval/tasks/mix_evals/image2text/mix_evals_image2text_mc_hard.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include: _default_template_yaml | ||
task: "mix_evals_image2text_mc_hard" | ||
dataset_name: "image2text" | ||
test_split: multiple_choice_hard | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mix_evals_image2text_doc_to_visual | ||
doc_to_text: !function utils.mix_evals_image2text_doc_to_text | ||
doc_to_target: "{{reference_answer}}" | ||
|
||
generation_kwargs: | ||
max_new_tokens: 1024 | ||
|
||
metric_list: | ||
- metric: exact_match | ||
aggregation: mean | ||
higher_is_better: true | ||
ignore_case: true | ||
ignore_punctuation: true | ||
|
||
filter_list: | ||
- name: "flexible-extract" | ||
filter: | ||
- function: !function utils.GPTMultiChoiceFilter |
Oops, something went wrong.