add readme (#10)
* Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * remove submodule * add mPLUG MiniGPT4 * Update Readme.md * Update Readme.md * Update Readme.md --------- Co-authored-by: Yuliang Liu <34134635+Yuliang-Liu@users.noreply.github.com>
This commit is contained in:
26
models/MiniGPT4/minigpt4/tasks/__init__.py
Normal file
26
models/MiniGPT4/minigpt4/tasks/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Copyright (c) 2022, salesforce.com, inc.
|
||||
All rights reserved.
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
For full license text, see the LICENSE_Lavis file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
||||
"""
|
||||
|
||||
from minigpt4.common.registry import registry
|
||||
from minigpt4.tasks.base_task import BaseTask
|
||||
from minigpt4.tasks.image_text_pretrain import ImageTextPretrainTask
|
||||
|
||||
|
||||
def setup_task(cfg):
|
||||
assert "task" in cfg.run_cfg, "Task name must be provided."
|
||||
|
||||
task_name = cfg.run_cfg.task
|
||||
task = registry.get_task_class(task_name).setup_task(cfg=cfg)
|
||||
assert task is not None, "Task {} not properly registered.".format(task_name)
|
||||
|
||||
return task
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BaseTask",
|
||||
"ImageTextPretrainTask",
|
||||
]
|
Reference in New Issue
Block a user