tykiww commited on
Commit
cbbdafb
·
verified ·
1 Parent(s): 18ea001

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -24,7 +24,7 @@ def upload_visibility(radio):
24
  else:
25
  return gr.UploadButton(visible=bool(0))
26
 
27
- def greet(model_name, inject_prompt, dataset):
28
  """The model call"""
29
  return f"Hello!! Using model: {model_name} with template: {inject_prompt}"
30
 
@@ -69,12 +69,18 @@ def main():
69
  sftparams = conf['model']['sft']
70
  # accordion container content
71
  gr.Markdown("### PEFT Parameters")
72
- r = gr.Textbox(label="r", value=peftparams['r'])
73
- alpha = gr.Textbox(label="LoRA alpha", value=peftparams['alpha'])
74
- dropout = gr.Textbox(label="LoRA dropout", value=peftparams['dropout'])
75
- bias = gr.Textbox(label="Bias", value=peftparams['bias'])
76
- seed = gr.Textbox(label="Random State", value=peftparams['seed'])
77
- rslora = gr.Textbox(label="Use R-S LoRA", value=peftparams['rslora'])
 
 
 
 
 
 
78
  pefts = [r, alpha, dropout, bias, seed, rslora]
79
 
80
  gr.Markdown("List of items")
@@ -89,7 +95,7 @@ def main():
89
  output = gr.Textbox(label="Output")
90
  # Execute button
91
  tune_btn.click(fn=greet,
92
- inputs=[model_name, inject_prompt, dataset_predefined],
93
  outputs=output)
94
  # Launch baby
95
  demo.launch()
 
24
  else:
25
  return gr.UploadButton(visible=bool(0))
26
 
27
+ def greet(model_name, inject_prompt, dataset, pefts):
28
  """The model call"""
29
  return f"Hello!! Using model: {model_name} with template: {inject_prompt}"
30
 
 
69
  sftparams = conf['model']['sft']
70
  # accordion container content
71
  gr.Markdown("### PEFT Parameters")
72
+ r = gr.Textbox(label="r",
73
+ value=peftparams['r'])
74
+ alpha = gr.Textbox(label="LoRA alpha",
75
+ value=peftparams['alpha'])
76
+ dropout = gr.Textbox(label="LoRA dropout",
77
+ value=peftparams['dropout'])
78
+ bias = gr.Textbox(label="Bias",
79
+ value=peftparams['bias'])
80
+ seed = gr.Textbox(label="Random State",
81
+ value=peftparams['seed'])
82
+ rslora = gr.Textbox(label="Use R-S LoRA",
83
+ value=peftparams['rslora'])
84
  pefts = [r, alpha, dropout, bias, seed, rslora]
85
 
86
  gr.Markdown("List of items")
 
95
  output = gr.Textbox(label="Output")
96
  # Execute button
97
  tune_btn.click(fn=greet,
98
+ inputs=[model_name, inject_prompt, dataset_predefined, pefts],
99
  outputs=output)
100
  # Launch baby
101
  demo.launch()