Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ def run_quantization(
|
|
| 17 |
layer_filter,
|
| 18 |
exclude_layers_regex,
|
| 19 |
full_precision_matrix_mult,
|
|
|
|
| 20 |
hf_token
|
| 21 |
):
|
| 22 |
if not all([source_repo, source_file, target_repo, target_filename_base]):
|
|
@@ -80,8 +81,11 @@ def run_quantization(
|
|
| 80 |
if full_precision_matrix_mult:
|
| 81 |
quant_args["full_precision_matrix_mult"] = True
|
| 82 |
|
| 83 |
-
if
|
| 84 |
-
quant_args["
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
yield f"Quantizing to {output_filename}...\nThis may take a few minutes.", gr.update(visible=False), gr.update(visible=False)
|
| 87 |
|
|
@@ -154,6 +158,7 @@ with gr.Blocks() as demo:
|
|
| 154 |
value="None", label="Model Layer Filter"
|
| 155 |
)
|
| 156 |
full_precision = gr.Checkbox(label="Full precision matrix multiplication", value=False)
|
|
|
|
| 157 |
|
| 158 |
exclude_layers = gr.Textbox(label="Exclude Layers Regex (Optional)", placeholder="(substring_1|substring_2)")
|
| 159 |
|
|
@@ -183,6 +188,7 @@ with gr.Blocks() as demo:
|
|
| 183 |
inputs=[
|
| 184 |
source_repo, source_file, target_repo, target_file_base,
|
| 185 |
quant_format, layer_filter, exclude_layers, full_precision,
|
|
|
|
| 186 |
hf_token
|
| 187 |
],
|
| 188 |
outputs=[status_text, output_link, output_file]
|
|
|
|
| 17 |
layer_filter,
|
| 18 |
exclude_layers_regex,
|
| 19 |
full_precision_matrix_mult,
|
| 20 |
+
generic_text,
|
| 21 |
hf_token
|
| 22 |
):
|
| 23 |
if not all([source_repo, source_file, target_repo, target_filename_base]):
|
|
|
|
| 81 |
if full_precision_matrix_mult:
|
| 82 |
quant_args["full_precision_matrix_mult"] = True
|
| 83 |
|
| 84 |
+
if generic_text:
|
| 85 |
+
quant_args["generic_text"] = True
|
| 86 |
+
|
| 87 |
+
if exclude_layers_regex:
|
| 88 |
+
quant_args["exclude_layers"] = exclude_layers_regex
|
| 89 |
|
| 90 |
yield f"Quantizing to {output_filename}...\nThis may take a few minutes.", gr.update(visible=False), gr.update(visible=False)
|
| 91 |
|
|
|
|
| 158 |
value="None", label="Model Layer Filter"
|
| 159 |
)
|
| 160 |
full_precision = gr.Checkbox(label="Full precision matrix multiplication", value=False)
|
| 161 |
+
generic_text = gr.Checkbox(label="Generic text model quantization", value=False)
|
| 162 |
|
| 163 |
exclude_layers = gr.Textbox(label="Exclude Layers Regex (Optional)", placeholder="(substring_1|substring_2)")
|
| 164 |
|
|
|
|
| 188 |
inputs=[
|
| 189 |
source_repo, source_file, target_repo, target_file_base,
|
| 190 |
quant_format, layer_filter, exclude_layers, full_precision,
|
| 191 |
+
generic_text,
|
| 192 |
hf_token
|
| 193 |
],
|
| 194 |
outputs=[status_text, output_link, output_file]
|