Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -64,16 +64,32 @@ def main():
|
|
64 |
dataset_choice.change(upload_visibility,
|
65 |
dataset_choice,
|
66 |
dataset_upload)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
# Hyperparameters (allow selection, but hide in accordion.)
|
68 |
with gr.Accordion("Advanced Tuning", open=False):
|
69 |
|
70 |
-
sftparams = conf['model']['
|
71 |
# accordion container content
|
72 |
dict_string = json.dumps(dict(conf['model']['peft']), indent=4)
|
73 |
peft = gr.Textbox(label="PEFT Parameters (json)", value=dict_string)
|
74 |
|
75 |
dict_string = json.dumps(dict(conf['model']['sft']), indent=4)
|
76 |
-
|
77 |
|
78 |
##### Execution #####
|
79 |
|
@@ -86,8 +102,15 @@ def main():
|
|
86 |
inputs=[model_name,
|
87 |
inject_prompt,
|
88 |
dataset_predefined,
|
89 |
-
peft
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
],
|
92 |
outputs=output)
|
93 |
# Launch baby
|
|
|
64 |
dataset_choice.change(upload_visibility,
|
65 |
dataset_choice,
|
66 |
dataset_upload)
|
67 |
+
# Parameters
|
68 |
+
max_seq_length = gr.Textbox(label="Maximum sequence length",
|
69 |
+
value=conf['model']['general']["max_seq_length"])
|
70 |
+
random_seed = gr.Textbox(label="Seed",
|
71 |
+
value=conf['model']['general']["seed"])
|
72 |
+
num_epochs = gr.Textbox(label="Training Epochs",
|
73 |
+
value=conf['model']['general']["num_train_epochs"])
|
74 |
+
max_steps = gr.Textbox(label="Maximum steps",
|
75 |
+
value=conf['model']['general']["max_steps"])
|
76 |
+
data_field = gr.Textbox(label="Dataset Training Field",
|
77 |
+
value=conf['model']['general']["dataset_text_field"])
|
78 |
+
repository = gr.Textbox(label="Repository Name",
|
79 |
+
value=conf['model']['general']["repository"])
|
80 |
+
model_out_name = gr.Textbox(label="Model Output Name",
|
81 |
+
value=conf['model']['general']["model_name"])
|
82 |
+
|
83 |
# Hyperparameters (allow selection, but hide in accordion.)
|
84 |
with gr.Accordion("Advanced Tuning", open=False):
|
85 |
|
86 |
+
sftparams = conf['model']['general']
|
87 |
# accordion container content
|
88 |
dict_string = json.dumps(dict(conf['model']['peft']), indent=4)
|
89 |
peft = gr.Textbox(label="PEFT Parameters (json)", value=dict_string)
|
90 |
|
91 |
dict_string = json.dumps(dict(conf['model']['sft']), indent=4)
|
92 |
+
sft = gr.Textbox(label="SFT Parameters (json)", value=dict_string)
|
93 |
|
94 |
##### Execution #####
|
95 |
|
|
|
102 |
inputs=[model_name,
|
103 |
inject_prompt,
|
104 |
dataset_predefined,
|
105 |
+
peft,
|
106 |
+
sft,
|
107 |
+
max_seq_length,
|
108 |
+
random_seed,
|
109 |
+
num_epochs,
|
110 |
+
max_steps,
|
111 |
+
data_field,
|
112 |
+
repository,
|
113 |
+
model_out_name
|
114 |
],
|
115 |
outputs=output)
|
116 |
# Launch baby
|