-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
53 lines (34 loc) · 1.63 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
import gradio as gr
from tabs.general_tab import GeneralTab
from tabs.prepare_tab import PrepareDatasetTab
from tabs.tool_tab import ToolTab
from tabs.training_tab import TrainingTab
from tabs.training_tab_legacy import LegacyTrainingTab
class App:
runtime_tab = None
prepare_tab = None
def __init__(self):
self.configs_path = "config/"
self.tabs = dict()
self.setup_views()
def setup_views(self):
with gr.Blocks() as app:
gr.Markdown("### finetrainers ui")
with gr.Tab("General Settings"):
self.tabs['general'] = GeneralTab("General Settings", os.path.join(self.configs_path, "editor.yaml"))
runtime_tab = gr.Tab("Trainer Settings")
tools_tab = gr.Tab("Lora Tools")
prepare_tab = gr.Tab("Prepare dataset (Legacy)")
runtime_tab_legacy = gr.Tab("Legacy Training Settings")
with runtime_tab:
self.tabs['runtime'] = TrainingTab("Trainer Settings", os.path.join(self.configs_path, "config_template.yaml"), allow_load=True)
with tools_tab:
self.tabs['tools'] = ToolTab()
with prepare_tab:
self.tabs['prepare'] = PrepareDatasetTab("Prepare dataset (Legacy)", os.path.join(self.configs_path, "prepare_template.yaml"), allow_load=True)
with runtime_tab_legacy:
self.tabs['runtime'] = LegacyTrainingTab("Legacy CogvideoX Settings", os.path.join(self.configs_path, "config_template_legacy.yaml"), allow_load=True)
app.launch()
if __name__ == "__main__":
App()