Skip to content

Commit b46239c

Browse files
authored
Merge pull request EvolvingLMMs-Lab#56 from gagan3012/main
Multilingual LLava bench
2 parents bc69a74 + 373265f commit b46239c

13 files changed

+641
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
from datasets import load_dataset
2+
3+
# dataset = load_dataset("gagan3012/multilingual-llava-bench")
4+
5+
configs = ['arabic', 'bengali', 'chinese', 'french', 'hindi', 'japanese', 'russian', 'spanish', 'urdu']
6+
7+
for config in configs:
8+
yaml_output = f"""
9+
dataset_path: "gagan3012/multilingual-llava-bench"
10+
dataset_kwargs:
11+
config: {config}
12+
token: True
13+
task: "llava_in_the_wild_{config}"
14+
test_split: train
15+
output_type: generate_until
16+
doc_to_visual: !function utils.llava_doc_to_visual
17+
doc_to_text: !function utils.llava_doc_to_text
18+
doc_to_target: "gpt_answer"
19+
generation_kwargs:
20+
until:
21+
- "ASSISTANT:"
22+
image_aspect_ratio: original
23+
max_new_tokens: 1024
24+
temperature: 0
25+
top_p: 0
26+
num_beams: 1
27+
do_sample: false
28+
process_results: !function utils.llava_process_results
29+
metric_list:
30+
- metric: gpt_eval_llava_all
31+
aggregation: !function utils.llava_all_aggregation
32+
higher_is_better: true
33+
- metric: gpt_eval_llava_conv
34+
aggregation: !function utils.llava_conv_aggregation
35+
higher_is_better: true
36+
- metric: gpt_eval_llava_detail
37+
aggregation: !function utils.llava_detail_aggregation
38+
higher_is_better: true
39+
- metric: gpt_eval_llava_complex
40+
aggregation: !function utils.llava_complex_aggregation
41+
higher_is_better: true
42+
metadata:
43+
version: 0.0
44+
gpt_eval_model_name: "gpt-4-0613"
45+
model_specific_prompt_kwargs:
46+
default:
47+
pre_prompt: ""
48+
post_prompt: ""
49+
"""
50+
51+
with open(f"{config}_llava_in_the_wild.yaml", "w") as f:
52+
f.write(yaml_output)
53+
54+
# Path: _generate_configs.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: arabic
5+
token: True
6+
task: "llava_in_the_wild_arabic"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: bengali
5+
token: True
6+
task: "llava_in_the_wild_bengali"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: chinese
5+
token: True
6+
task: "llava_in_the_wild_chinese"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: french
5+
token: True
6+
task: "llava_in_the_wild_french"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: hindi
5+
token: True
6+
task: "llava_in_the_wild_hindi"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
dataset_path: "gagan3012/multilingual-llava-bench"
3+
dataset_kwargs:
4+
config: japanese
5+
token: True
6+
task: "llava_in_the_wild_japanese"
7+
test_split: train
8+
output_type: generate_until
9+
doc_to_visual: !function utils.llava_doc_to_visual
10+
doc_to_text: !function utils.llava_doc_to_text
11+
doc_to_target: "gpt_answer"
12+
generation_kwargs:
13+
until:
14+
- "ASSISTANT:"
15+
image_aspect_ratio: original
16+
max_new_tokens: 1024
17+
temperature: 0
18+
top_p: 0
19+
num_beams: 1
20+
do_sample: false
21+
process_results: !function utils.llava_process_results
22+
metric_list:
23+
- metric: gpt_eval_llava_all
24+
aggregation: !function utils.llava_all_aggregation
25+
higher_is_better: true
26+
- metric: gpt_eval_llava_conv
27+
aggregation: !function utils.llava_conv_aggregation
28+
higher_is_better: true
29+
- metric: gpt_eval_llava_detail
30+
aggregation: !function utils.llava_detail_aggregation
31+
higher_is_better: true
32+
- metric: gpt_eval_llava_complex
33+
aggregation: !function utils.llava_complex_aggregation
34+
higher_is_better: true
35+
metadata:
36+
version: 0.0
37+
gpt_eval_model_name: "gpt-4-0613"
38+
model_specific_prompt_kwargs:
39+
default:
40+
pre_prompt: ""
41+
post_prompt: ""
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"coding": {"role": "Assistant", "prompt": "Your task is to evaluate the coding abilities of the above two assistants. They have been asked to implement a program to solve a given problem. Please review their code submissions, paying close attention to their problem-solving approach, code structure, readability, and the inclusion of helpful comments.\n\nPlease ensure that the assistants' submissions:\n\n1. Correctly implement the given problem statement.\n2. Contain accurate and efficient code.\n3. Include clear and concise comments that explain the code's logic and functionality.\n4. Adhere to proper coding standards and best practices.\n\nOnce you have carefully reviewed both submissions, provide detailed feedback on their strengths and weaknesses, along with any suggestions for improvement. You should first output a single line containing two scores on the scale of 1-10 (1: no code/no sense; 10: perfect) for Assistant 1 and 2, respectively. Then give extra comments starting from the next line."},
3+
"math": {"role": "Assistant", "prompt": "We would like to request your feedback on the mathematical proficiency of two AI assistants regarding the given user question.\nFirstly, please solve the problem independently, without referring to the answers provided by Assistant 1 and Assistant 2.\nAfterward, please examine the problem-solving process of Assistant 1 and Assistant 2 step-by-step to ensure their correctness, identifying any incorrect steps if present. Your evaluation should take into account not only the answer but also the problem-solving steps.\nFinally, please output a Python tuple containing two numerical scores for Assistant 1 and Assistant 2, ranging from 1 to 10, respectively. If applicable, explain the reasons for any variations in their scores and determine which assistant performed better."},
4+
"default": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above.\nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
5+
"conv": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with five descriptive sentences describing the same image and the bounding box coordinates of each object in the scene. These coordinates are in the form of bounding boxes, represented as (x1, y1, x2, y2) with floating numbers ranging from 0 to 1. These values correspond to the top left x, top left y, bottom right x, and bottom right y. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
6+
"detail": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with five descriptive sentences describing the same image and the bounding box coordinates of each object in the scene. These coordinates are in the form of bounding boxes, represented as (x1, y1, x2, y2) with floating numbers ranging from 0 to 1. These values correspond to the top left x, top left y, bottom right x, and bottom right y. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
7+
"complex": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with five descriptive sentences describing the same image and the bounding box coordinates of each object in the scene. These coordinates are in the form of bounding boxes, represented as (x1, y1, x2, y2) with floating numbers ranging from 0 to 1. These values correspond to the top left x, top left y, bottom right x, and bottom right y. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
8+
"llava_bench_conv": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with a few sentences describing the image. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
9+
"llava_bench_detail": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with a few sentences describing the image. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."},
10+
"llava_bench_complex": {"role": "Assistant", "prompt": "We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. The user asks the question on observing an image. For your reference, the visual content in the image is represented with a few sentences describing the image. \nPlease rate the helpfulness, relevance, accuracy, level of details of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance.\nPlease first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space.\nIn the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment."}
11+
}

0 commit comments

Comments
 (0)