Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
adapter weights support
Browse files
app.py
CHANGED
@@ -211,6 +211,7 @@ def add_new_eval(
|
|
211 |
is_8_bit_eval: bool,
|
212 |
private: bool,
|
213 |
is_delta_weight: bool,
|
|
|
214 |
):
|
215 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
216 |
|
@@ -218,7 +219,10 @@ def add_new_eval(
|
|
218 |
if revision == "":
|
219 |
revision = "main"
|
220 |
|
221 |
-
if is_delta_weight:
|
|
|
|
|
|
|
222 |
base_model_on_hub, error = is_model_on_hub(base_model, revision)
|
223 |
if not base_model_on_hub:
|
224 |
return styled_error(f'Base model "{base_model}" {error}')
|
@@ -236,6 +240,7 @@ def add_new_eval(
|
|
236 |
"private": private,
|
237 |
"8bit_eval": is_8_bit_eval,
|
238 |
"is_delta_weight": is_delta_weight,
|
|
|
239 |
"status": "PENDING",
|
240 |
"submitted_time": current_time,
|
241 |
}
|
@@ -433,8 +438,9 @@ with demo:
|
|
433 |
False, label="Private", visible=not IS_PUBLIC
|
434 |
)
|
435 |
is_delta_weight = gr.Checkbox(False, label="Delta weights")
|
|
|
436 |
base_model_name_textbox = gr.Textbox(
|
437 |
-
label="base model (for delta)"
|
438 |
)
|
439 |
|
440 |
submit_button = gr.Button("Submit Eval")
|
@@ -448,6 +454,7 @@ with demo:
|
|
448 |
is_8bit_toggle,
|
449 |
private,
|
450 |
is_delta_weight,
|
|
|
451 |
],
|
452 |
submission_result,
|
453 |
)
|
|
|
211 |
is_8_bit_eval: bool,
|
212 |
private: bool,
|
213 |
is_delta_weight: bool,
|
214 |
+
is_adapter_weight: bool,
|
215 |
):
|
216 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
217 |
|
|
|
219 |
if revision == "":
|
220 |
revision = "main"
|
221 |
|
222 |
+
if is_delta_weight and is_adapter_weight:
|
223 |
+
return styled_error("Cannot be both delta and adapter weight")
|
224 |
+
|
225 |
+
if is_delta_weight or is_adapter_weight:
|
226 |
base_model_on_hub, error = is_model_on_hub(base_model, revision)
|
227 |
if not base_model_on_hub:
|
228 |
return styled_error(f'Base model "{base_model}" {error}')
|
|
|
240 |
"private": private,
|
241 |
"8bit_eval": is_8_bit_eval,
|
242 |
"is_delta_weight": is_delta_weight,
|
243 |
+
"is_adapter_weight": is_adapter_weight,
|
244 |
"status": "PENDING",
|
245 |
"submitted_time": current_time,
|
246 |
}
|
|
|
438 |
False, label="Private", visible=not IS_PUBLIC
|
439 |
)
|
440 |
is_delta_weight = gr.Checkbox(False, label="Delta weights")
|
441 |
+
is_adapter_weight = gr.Checkbox(False, label="Adapter weights")
|
442 |
base_model_name_textbox = gr.Textbox(
|
443 |
+
label="base model (for delta / adapter)"
|
444 |
)
|
445 |
|
446 |
submit_button = gr.Button("Submit Eval")
|
|
|
454 |
is_8bit_toggle,
|
455 |
private,
|
456 |
is_delta_weight,
|
457 |
+
is_adapter_weight,
|
458 |
],
|
459 |
submission_result,
|
460 |
)
|