Colby commited on
Commit
7602b25
·
verified ·
1 Parent(s): 8774749

Upload convert_soc_to_gguf.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. convert_soc_to_gguf.py +5 -3
convert_soc_to_gguf.py CHANGED
@@ -41,12 +41,14 @@ LLAMA_CPP_DIR = "/tmp/llama.cpp"
41
 
42
  def run(cmd, desc):
43
  print(f" {desc}...")
44
- result = subprocess.run(cmd, capture_output=True, text=True)
45
  if result.returncode != 0:
46
- print(f" FAILED: {result.stderr[:600]}")
 
47
  sys.exit(1)
48
  if result.stdout:
49
- print(f" {result.stdout[:200]}")
 
50
  return True
51
 
52
 
 
41
 
42
  def run(cmd, desc):
43
  print(f" {desc}...")
44
+ result = subprocess.run(cmd, capture_output=True) # raw bytes — avoid UTF-8 decode errors from binary progress output
45
  if result.returncode != 0:
46
+ stderr = result.stderr.decode("utf-8", errors="replace")[:600]
47
+ print(f" FAILED: {stderr}")
48
  sys.exit(1)
49
  if result.stdout:
50
+ stdout = result.stdout.decode("utf-8", errors="replace")[:200]
51
+ print(f" {stdout}")
52
  return True
53
 
54