KBaba7 commited on
Commit
c306a09
·
verified ·
1 Parent(s): 21e2278

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- cmd = [
55
- f"{model_dir_path}/build/bin/llama-quantize",
56
- model_path,
57
- quantized_output_path,
58
- quant_type
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: