mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-03 04:02:49 +08:00
add quant check in webui export tab
Former-commit-id: c94e6c9411cc1165ea8180d377611a3ae47956e6
This commit is contained in:
parent
4c40171c55
commit
27777c8e68
@ -21,6 +21,13 @@ if TYPE_CHECKING:
|
|||||||
GPTQ_BITS = ["8", "4", "3", "2"]
|
GPTQ_BITS = ["8", "4", "3", "2"]
|
||||||
|
|
||||||
|
|
||||||
|
def can_quantize(checkpoint_path: Union[str, List[str]]) -> "gr.Dropdown":
|
||||||
|
if isinstance(checkpoint_path, list) and len(checkpoint_path) != 0:
|
||||||
|
return gr.Dropdown(value="none", interactive=False)
|
||||||
|
else:
|
||||||
|
return gr.Dropdown(interactive=True)
|
||||||
|
|
||||||
|
|
||||||
def save_model(
|
def save_model(
|
||||||
lang: str,
|
lang: str,
|
||||||
model_name: str,
|
model_name: str,
|
||||||
@ -96,6 +103,9 @@ def create_export_tab(engine: "Engine") -> Dict[str, "Component"]:
|
|||||||
export_dir = gr.Textbox()
|
export_dir = gr.Textbox()
|
||||||
export_hub_model_id = gr.Textbox()
|
export_hub_model_id = gr.Textbox()
|
||||||
|
|
||||||
|
checkpoint_path: gr.Dropdown = engine.manager.get_elem_by_id("top.checkpoint_path")
|
||||||
|
checkpoint_path.change(can_quantize, [checkpoint_path], [export_quantization_bit], queue=False)
|
||||||
|
|
||||||
export_btn = gr.Button()
|
export_btn = gr.Button()
|
||||||
info_box = gr.Textbox(show_label=False, interactive=False)
|
info_box = gr.Textbox(show_label=False, interactive=False)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user