edbeeching commited on
Commit
a095268
1 Parent(s): fcb01e3

adds base model for delta weight merging

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -115,11 +115,14 @@ def is_model_on_hub(model_name, revision) -> bool:
115
 
116
 
117
 
118
- def add_new_eval(model:str, revision:str, private:bool, is_8_bit_eval: bool, is_delta_weight:bool):
119
  # check the model actually exists before adding the eval
120
  if revision == "":
121
  revision = "main"
122
- print("revision", revision)
 
 
 
123
  if not is_model_on_hub(model, revision):
124
  print(model, "not found on hub")
125
  return
@@ -127,6 +130,7 @@ def add_new_eval(model:str, revision:str, private:bool, is_8_bit_eval: bool, is_
127
 
128
  eval_entry = {
129
  "model" : model,
 
130
  "revision" : revision,
131
  "private" : private,
132
  "8bit_eval" : is_8_bit_eval,
@@ -198,6 +202,7 @@ with block:
198
  with gr.Column():
199
  model_name_textbox = gr.Textbox(label="Model name")
200
  revision_name_textbox = gr.Textbox(label="revision", placeholder="main")
 
201
  with gr.Column():
202
  is_8bit_toggle = gr.Checkbox(False, label="8 bit eval")
203
  private = gr.Checkbox(False, label="Private")
@@ -205,7 +210,7 @@ with block:
205
 
206
  with gr.Row():
207
  submit_button = gr.Button("Submit Eval")
208
- submit_button.click(add_new_eval, [model_name_textbox, revision_name_textbox, is_8bit_toggle, private, is_delta_weight])
209
 
210
 
211
 
 
115
 
116
 
117
 
118
+ def add_new_eval(model:str, base_model : str, revision:str, private:bool, is_8_bit_eval: bool, is_delta_weight:bool):
119
  # check the model actually exists before adding the eval
120
  if revision == "":
121
  revision = "main"
122
+ if is_delta_weight and not is_model_on_hub(base_model, revision):
123
+ print(base_model, "base model not found on hub")
124
+ return
125
+
126
  if not is_model_on_hub(model, revision):
127
  print(model, "not found on hub")
128
  return
 
130
 
131
  eval_entry = {
132
  "model" : model,
133
+ "base_model" : base_model,
134
  "revision" : revision,
135
  "private" : private,
136
  "8bit_eval" : is_8_bit_eval,
 
202
  with gr.Column():
203
  model_name_textbox = gr.Textbox(label="Model name")
204
  revision_name_textbox = gr.Textbox(label="revision", placeholder="main")
205
+ base_model_name_textbox = gr.Textbox(label="base model (for delta)")
206
  with gr.Column():
207
  is_8bit_toggle = gr.Checkbox(False, label="8 bit eval")
208
  private = gr.Checkbox(False, label="Private")
 
210
 
211
  with gr.Row():
212
  submit_button = gr.Button("Submit Eval")
213
+ submit_button.click(add_new_eval, [model_name_textbox, base_model_name_textbox, revision_name_textbox, is_8bit_toggle, private, is_delta_weight])
214
 
215
 
216