[Feature]: Add mm suport for local (#169)

This commit is contained in:
Yuan Liu 2023-08-08 14:21:58 +08:00 committed by GitHub
parent 5b80d83866
commit 2f1949e7a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -9,7 +9,7 @@ val_pipeline = [
std=(0.26862954, 0.26130258, 0.27577711)), std=(0.26862954, 0.26130258, 0.27577711)),
dict(type='mmpretrain.PackInputs', dict(type='mmpretrain.PackInputs',
algorithm_keys=[ algorithm_keys=[
'question', 'answer', 'category', 'l2-category', 'context', 'question', 'category', 'l2-category', 'context',
'index', 'options_dict', 'options', 'split' 'index', 'options_dict', 'options', 'split'
]) ])
] ]

View File

@ -9,7 +9,7 @@ val_pipeline = [
std=(0.26862954, 0.26130258, 0.27577711)), std=(0.26862954, 0.26130258, 0.27577711)),
dict(type='mmpretrain.PackInputs', dict(type='mmpretrain.PackInputs',
algorithm_keys=[ algorithm_keys=[
'question', 'answer', 'category', 'l2-category', 'context', 'question', 'category', 'l2-category', 'context',
'index', 'options_dict', 'options', 'split' 'index', 'options_dict', 'options', 'split'
]) ])
] ]

View File

@ -64,6 +64,20 @@ class MultimodalInferTask:
evaluator_name = self.evaluator[0]['type'] evaluator_name = self.evaluator[0]['type']
return f'{model_name}-{dataset_name}-{evaluator_name}' return f'{model_name}-{dataset_name}-{evaluator_name}'
def get_log_path(self, file_extension: str = 'json') -> str:
"""Get the path to the log file.
Args:
file_extension (str): The file extension of the log file.
Default: 'json'.
"""
model_name = self.model['type']
dataset_name = self.dataloader['dataset']['type']
evaluator_name = self.evaluator[0]['type']
return osp.join(model_name,
f'{dataset_name}-{evaluator_name}.{file_extension}')
def get_command(self, cfg_path, template): def get_command(self, cfg_path, template):
"""Get the command template for the task. """Get the command template for the task.