Spaces:
Running
Running
Upload model_manager.py
Browse files- model_manager.py +7 -1
model_manager.py
CHANGED
|
@@ -132,8 +132,12 @@ class BitNetManager:
|
|
| 132 |
def get_binary_path(self):
|
| 133 |
"""Locate the bitnet binary based on platform/build structure."""
|
| 134 |
possible_paths = [
|
| 135 |
-
os.path.join(self.bitnet_dir, "build", "
|
|
|
|
|
|
|
|
|
|
| 136 |
os.path.join(self.bitnet_dir, "build", "Release", "bitnet.exe"), # Windows
|
|
|
|
| 137 |
os.path.join(self.bitnet_dir, "run_inference.py") # Script fallback
|
| 138 |
]
|
| 139 |
for p in possible_paths:
|
|
@@ -171,8 +175,10 @@ class BitNetManager:
|
|
| 171 |
|
| 172 |
try:
|
| 173 |
# We'll return a Popen object so the app can stream the response
|
|
|
|
| 174 |
process = subprocess.Popen(
|
| 175 |
cmd,
|
|
|
|
| 176 |
stdout=subprocess.PIPE,
|
| 177 |
stderr=subprocess.PIPE,
|
| 178 |
text=True,
|
|
|
|
| 132 |
def get_binary_path(self):
|
| 133 |
"""Locate the bitnet binary based on platform/build structure."""
|
| 134 |
possible_paths = [
|
| 135 |
+
os.path.join(self.bitnet_dir, "build", "bin", "llama-cli"), # Standard location
|
| 136 |
+
os.path.join(self.bitnet_dir, "build", "llama-cli"), # Alternate location
|
| 137 |
+
os.path.join(self.bitnet_dir, "build", "bitnet"), # Legacy/Custom
|
| 138 |
+
os.path.join(self.bitnet_dir, "build", "bin", "bitnet"),
|
| 139 |
os.path.join(self.bitnet_dir, "build", "Release", "bitnet.exe"), # Windows
|
| 140 |
+
os.path.join(self.bitnet_dir, "build", "bin", "Release", "llama-cli.exe"),
|
| 141 |
os.path.join(self.bitnet_dir, "run_inference.py") # Script fallback
|
| 142 |
]
|
| 143 |
for p in possible_paths:
|
|
|
|
| 175 |
|
| 176 |
try:
|
| 177 |
# We'll return a Popen object so the app can stream the response
|
| 178 |
+
# CRITICAL: We must set cwd=self.bitnet_dir so run_inference.py can find build/
|
| 179 |
process = subprocess.Popen(
|
| 180 |
cmd,
|
| 181 |
+
cwd=self.bitnet_dir,
|
| 182 |
stdout=subprocess.PIPE,
|
| 183 |
stderr=subprocess.PIPE,
|
| 184 |
text=True,
|