Upload convert_soc_to_gguf.py with huggingface_hub
Browse files- 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
|
| 45 |
if result.returncode != 0:
|
| 46 |
-
|
|
|
|
| 47 |
sys.exit(1)
|
| 48 |
if result.stdout:
|
| 49 |
-
|
|
|
|
| 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 |
|