-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,218 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from datasets import load_dataset, Dataset | ||
|
||
# Load the deduplicated VideoSearch dataset | ||
videosearch_dataset = load_dataset('lmms-lab/VideoSearch', 'deduplicated_combined_milestone', split='test') | ||
|
||
# ID to be removed | ||
id_to_remove = 'validation_Biology_18' | ||
|
||
# Filter out the row with the missing ID | ||
filtered_rows = [row for row in videosearch_dataset if row['id'] != id_to_remove] | ||
|
||
# Create a new dataset from the filtered rows | ||
filtered_dataset = Dataset.from_list(filtered_rows) | ||
|
||
# Save the filtered dataset locally or push it to Hugging Face hub | ||
filtered_dataset.push_to_hub("lmms-lab/VideoSearch", "final_combined_milestone", split="test") | ||
|
||
# Check and print the number of rows before and after filtering | ||
print(f"Original dataset size: {len(videosearch_dataset)}") | ||
print(f"Filtered dataset size: {len(filtered_dataset)}") |
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,33 @@ | ||
import os | ||
from datasets import load_dataset | ||
|
||
# Load the VideoSearch dataset | ||
videosearch_dataset = load_dataset('lmms-lab/VideoSearch', 'final_combined_milestone', split='test') | ||
|
||
# Path to the videos directory (replace with your actual path) | ||
videos_directory = '/mnt/sfs-common/krhu/.cache/huggingface/Combined_milestone/videos/' | ||
|
||
# Get all IDs from the dataset | ||
videosearch_ids = set(videosearch_dataset['id']) | ||
|
||
# List to store IDs of files that are not in the dataset | ||
extra_files = [] | ||
|
||
# Loop through all .mp4 files in the videos directory | ||
for file in os.listdir(videos_directory): | ||
if file.endswith('.mp4'): | ||
# Extract the ID from the file name (remove the .mp4 extension) | ||
file_id = file.replace('.mp4', '') | ||
|
||
# Check if the file ID exists in the VideoSearch dataset | ||
if file_id not in videosearch_ids: | ||
extra_files.append(file_id) | ||
|
||
# Print the IDs of .mp4 files that are not in the dataset | ||
if extra_files: | ||
print(f"MP4 files not included in the VideoSearch dataset: {extra_files}") | ||
else: | ||
print("All MP4 files have corresponding entries in the VideoSearch dataset.") | ||
|
||
# Optionally, print the total number of extra files | ||
print(f"Total extra MP4 files: {len(extra_files)}") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
generation_kwargs: | ||
max_new_tokens: 4096 | ||
|
||
metadata: | ||
version: 0.0 | ||
interleaved_format: false |
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: mmmu | ||
task: | ||
- mmmu_testing_val |
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 @@ | ||
dataset_path: lmms-lab/MMMU_for_testing | ||
dataset_name: "updated_first_milestone" | ||
task: "mmmu_testing_val" | ||
test_split: train | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mmmu_doc_to_visual | ||
doc_to_text: !function utils.mmmu_doc_to_text | ||
doc_to_target: "answer" | ||
# The return value of process_results will be used by metrics | ||
process_results: !function utils.mmmu_process_results | ||
|
||
metric_list: | ||
- metric: mmmu_acc | ||
aggregation: !function utils.mmmu_aggregate_results | ||
higher_is_better: true | ||
|
||
include: _default_template_yaml |
17 changes: 17 additions & 0 deletions
17
lmms_eval/tasks/mmmu_for_testing/testing_combined_milestone.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 @@ | ||
dataset_path: lmms-lab/MMMU_for_testing | ||
dataset_name: "combined_milestone" | ||
task: "mmmu_testing_combined_milestone" | ||
test_split: test | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mmmu_doc_to_visual | ||
doc_to_text: !function utils.mmmu_doc_to_text | ||
doc_to_target: "answer" | ||
# The return value of process_results will be used by metrics | ||
process_results: !function utils.mmmu_process_results | ||
|
||
metric_list: | ||
- metric: mmmu_acc | ||
aggregation: !function utils.mmmu_aggregate_results | ||
higher_is_better: true | ||
|
||
include: _default_template_yaml |
Oops, something went wrong.