Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -51,13 +51,13 @@ def quantize_llama(model_path, quantized_output_path, quant_type):
|
|
51 |
"""
|
52 |
st.write(f"⚡ Quantizing `{model_path}` with `{quant_type}` precision...")
|
53 |
os.makedirs(os.path.dirname(quantized_output_path), exist_ok=True)
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
]
|
60 |
process = subprocess.run(cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
61 |
if process.returncode == 0:
|
62 |
st.success(f"✅ Quantized model saved at `{quantized_output_path}`")
|
63 |
else:
|
|
|
51 |
"""
|
52 |
st.write(f"⚡ Quantizing `{model_path}` with `{quant_type}` precision...")
|
53 |
os.makedirs(os.path.dirname(quantized_output_path), exist_ok=True)
|
54 |
+
uantize_path = f"{model_dir_path}/build/bin/llama-quantize"
|
55 |
+
subprocess.run(["chmod", "+x", quantize_path], check=True)
|
56 |
+
|
57 |
+
cmd = [quantize_path, input_file, output_file, quant_type]
|
58 |
+
|
|
|
59 |
process = subprocess.run(cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
60 |
+
|
61 |
if process.returncode == 0:
|
62 |
st.success(f"✅ Quantized model saved at `{quantized_output_path}`")
|
63 |
else:
|