|
1 | 1 | # Copyright (c) Alibaba, Inc. and its affiliates. |
2 | | -from typing import TYPE_CHECKING |
3 | | - |
4 | | -from swift.utils.import_utils import _LazyModule |
| 2 | +from .app_ui import gradio_chat_demo, gradio_generation_demo, llm_app_ui |
| 3 | +from .infer import llm_infer, merge_lora, prepare_model_template |
| 4 | +from .rome import rome_infer |
| 5 | +# Recommend using `xxx_main` |
| 6 | +from .run import (app_ui_main, dpo_main, infer_main, merge_lora_main, |
| 7 | + rome_main, sft_main) |
| 8 | +from .sft import llm_sft |
5 | 9 | from .utils import * |
6 | | - |
7 | | -if TYPE_CHECKING: |
8 | | - from .app_ui import gradio_chat_demo, gradio_generation_demo, llm_app_ui |
9 | | - from .infer import llm_infer, merge_lora, prepare_model_template |
10 | | - from .rome import rome_infer |
11 | | - # Recommend using `xxx_main` |
12 | | - from .run import (app_ui_main, dpo_main, infer_main, merge_lora_main, |
13 | | - rome_main, sft_main) |
14 | | - from .sft import llm_sft |
15 | | -else: |
16 | | - _import_structure = { |
17 | | - 'app_ui': ['gradio_chat_demo', 'gradio_generation_demo', 'llm_app_ui'], |
18 | | - 'infer': ['llm_infer', 'merge_lora', 'prepare_model_template'], |
19 | | - 'rome': ['rome_infer'], |
20 | | - 'run': [ |
21 | | - 'app_ui_main', 'dpo_main', 'infer_main', 'merge_lora_main', |
22 | | - 'rome_main', 'sft_main' |
23 | | - ], |
24 | | - 'sft': ['llm_sft'], |
25 | | - } |
26 | | - |
27 | | - import sys |
28 | | - |
29 | | - sys.modules[__name__] = _LazyModule( |
30 | | - __name__, |
31 | | - globals()['__file__'], |
32 | | - _import_structure, |
33 | | - module_spec=__spec__, |
34 | | - extra_objects={}, |
35 | | - ) |
0 commit comments