Download MedEvalKit/utils/MMMU/MMMU.py from Master-Shi/ExplainableVQA: direct link, hf CLI and curl.
- Browser
- Download file 955 Bytes
-
https://huggingface.co/datasets/Master-Shi/ExplainableVQA/resolve/main/MedEvalKit/utils/MMMU/MMMU.py
- Command line
-
hf download hf://datasets/Master-Shi/ExplainableVQA/MedEvalKit/utils/MMMU/MMMU.py
-
curl -L -o MMMU.py https://huggingface.co/datasets/Master-Shi/ExplainableVQA/resolve/main/MedEvalKit/utils/MMMU/MMMU.py
955 Bytes
| from .eval_val import eval_MMMU_val | |
| from .eval_test import eval_MMMU_test | |
| class MMMU: | |
| def __init__(self,model,dataset_path,output_path,split = "test",subset = "Medical"): | |
| self.split = split | |
| self.subset = subset | |
| self.model = model | |
| self.output_path = output_path | |
| self.dataset_path = dataset_path if dataset_path else "MMMU/MMMU" | |
| self.samples = [] | |
| def load_data(self): | |
| pass | |
| def eval(self): | |
| model = self.model | |
| dataset_path = self.dataset_path | |
| output_path = self.output_path | |
| if self.subset == "Medical": | |
| subset = "Health and Medicine" | |
| elif self.subset == "Science": | |
| subset = "Science" | |
| if self.split == "test": | |
| matrics = eval_MMMU_test(model,dataset_path,output_path,subset) | |
| else: | |
| matrics = eval_MMMU_val(model,dataset_path,output_path,subset) | |
| return matrics | |