Spaces:
Sleeping
Sleeping
replace qwen2.5 0.5b with qwen2.5 coder 1.5b
Browse files- ai_analysis.py +11 -11
- download_model.py +5 -5
ai_analysis.py
CHANGED
|
@@ -222,12 +222,12 @@ class AIAnalyzer:
|
|
| 222 |
if model_path is None:
|
| 223 |
# Try default locations (existing files)
|
| 224 |
possible_paths = [
|
| 225 |
-
Path("./qwen2.5-
|
| 226 |
-
Path("../qwen2.5-
|
| 227 |
-
Path.home() / "rts" / "qwen2.5-
|
| 228 |
-
Path.home() / ".cache" / "rts" / "qwen2.5-
|
| 229 |
-
Path("/data/qwen2.5-
|
| 230 |
-
Path("/tmp/rts/qwen2.5-
|
| 231 |
]
|
| 232 |
|
| 233 |
for path in possible_paths:
|
|
@@ -249,11 +249,11 @@ class AIAnalyzer:
|
|
| 249 |
import sys
|
| 250 |
import urllib.request
|
| 251 |
|
| 252 |
-
model_url = "https://huggingface.co/Qwen/Qwen2.5-
|
| 253 |
# Fallback URL (blob with download param)
|
| 254 |
-
alt_url = "https://huggingface.co/Qwen/Qwen2.5-
|
| 255 |
# Choose a writable destination directory
|
| 256 |
-
filename = "qwen2.5-
|
| 257 |
candidate_dirs = [
|
| 258 |
Path(os.getenv("RTS_MODEL_DIR", "")),
|
| 259 |
Path.cwd(),
|
|
@@ -385,7 +385,7 @@ class AIAnalyzer:
|
|
| 385 |
})
|
| 386 |
else:
|
| 387 |
print(f"❌ Download failed. Tactical analysis disabled.")
|
| 388 |
-
print(f" Manual download: https://huggingface.co/Qwen/Qwen2.5-
|
| 389 |
_update_model_download_status({
|
| 390 |
'status': 'error',
|
| 391 |
'percent': 0,
|
|
@@ -396,7 +396,7 @@ class AIAnalyzer:
|
|
| 396 |
except Exception as e:
|
| 397 |
print(f"❌ Auto-download failed: {e}")
|
| 398 |
print(f" Tactical analysis disabled.")
|
| 399 |
-
print(f" Manual download: https://huggingface.co/Qwen/Qwen2.5-
|
| 400 |
_update_model_download_status({
|
| 401 |
'status': 'error',
|
| 402 |
'percent': 0,
|
|
|
|
| 222 |
if model_path is None:
|
| 223 |
# Try default locations (existing files)
|
| 224 |
possible_paths = [
|
| 225 |
+
Path("./qwen2.5-coder-1.5b-instruct-q4_0.gguf"),
|
| 226 |
+
Path("../qwen2.5-coder-1.5b-instruct-q4_0.gguf"),
|
| 227 |
+
Path.home() / "rts" / "qwen2.5-coder-1.5b-instruct-q4_0.gguf",
|
| 228 |
+
Path.home() / ".cache" / "rts" / "qwen2.5-coder-1.5b-instruct-q4_0.gguf",
|
| 229 |
+
Path("/data/qwen2.5-coder-1.5b-instruct-q4_0.gguf"),
|
| 230 |
+
Path("/tmp/rts/qwen2.5-coder-1.5b-instruct-q4_0.gguf"),
|
| 231 |
]
|
| 232 |
|
| 233 |
for path in possible_paths:
|
|
|
|
| 249 |
import sys
|
| 250 |
import urllib.request
|
| 251 |
|
| 252 |
+
model_url = "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_0.gguf"
|
| 253 |
# Fallback URL (blob with download param)
|
| 254 |
+
alt_url = "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/blob/main/qwen2.5-coder-1.5b-instruct-q4_0.gguf?download=1"
|
| 255 |
# Choose a writable destination directory
|
| 256 |
+
filename = "qwen2.5-coder-1.5b-instruct-q4_0.gguf"
|
| 257 |
candidate_dirs = [
|
| 258 |
Path(os.getenv("RTS_MODEL_DIR", "")),
|
| 259 |
Path.cwd(),
|
|
|
|
| 385 |
})
|
| 386 |
else:
|
| 387 |
print(f"❌ Download failed. Tactical analysis disabled.")
|
| 388 |
+
print(f" Manual download: https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF")
|
| 389 |
_update_model_download_status({
|
| 390 |
'status': 'error',
|
| 391 |
'percent': 0,
|
|
|
|
| 396 |
except Exception as e:
|
| 397 |
print(f"❌ Auto-download failed: {e}")
|
| 398 |
print(f" Tactical analysis disabled.")
|
| 399 |
+
print(f" Manual download: https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF")
|
| 400 |
_update_model_download_status({
|
| 401 |
'status': 'error',
|
| 402 |
'percent': 0,
|
download_model.py
CHANGED
|
@@ -51,17 +51,17 @@ def download_model(destination: Optional[str] = None):
|
|
| 51 |
|
| 52 |
Args:
|
| 53 |
destination: Target path for model file.
|
| 54 |
-
Defaults to /home/luigi/rts/qwen2.5-
|
| 55 |
|
| 56 |
Returns:
|
| 57 |
str: Path to downloaded model
|
| 58 |
"""
|
| 59 |
# Model URL from HuggingFace
|
| 60 |
-
MODEL_URL = "https://huggingface.co/Qwen/Qwen2.5-
|
| 61 |
|
| 62 |
# Default destination
|
| 63 |
if destination is None:
|
| 64 |
-
destination = "/home/luigi/rts/qwen2.5-
|
| 65 |
|
| 66 |
destination_path = Path(destination)
|
| 67 |
|
|
@@ -121,7 +121,7 @@ def main():
|
|
| 121 |
'-d',
|
| 122 |
type=str,
|
| 123 |
default=None,
|
| 124 |
-
help='Destination path (default: /home/luigi/rts/qwen2.5-
|
| 125 |
)
|
| 126 |
|
| 127 |
args = parser.parse_args()
|
|
@@ -145,7 +145,7 @@ def main():
|
|
| 145 |
else:
|
| 146 |
print()
|
| 147 |
print("❌ Setup failed. Please try again or download manually from:")
|
| 148 |
-
print(" https://huggingface.co/Qwen/Qwen2.5-
|
| 149 |
sys.exit(1)
|
| 150 |
|
| 151 |
|
|
|
|
| 51 |
|
| 52 |
Args:
|
| 53 |
destination: Target path for model file.
|
| 54 |
+
Defaults to /home/luigi/rts/qwen2.5-coder-1.5b-instruct-q4_0.gguf
|
| 55 |
|
| 56 |
Returns:
|
| 57 |
str: Path to downloaded model
|
| 58 |
"""
|
| 59 |
# Model URL from HuggingFace
|
| 60 |
+
MODEL_URL = "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_0.gguf"
|
| 61 |
|
| 62 |
# Default destination
|
| 63 |
if destination is None:
|
| 64 |
+
destination = "/home/luigi/rts/qwen2.5-coder-1.5b-instruct-q4_0.gguf"
|
| 65 |
|
| 66 |
destination_path = Path(destination)
|
| 67 |
|
|
|
|
| 121 |
'-d',
|
| 122 |
type=str,
|
| 123 |
default=None,
|
| 124 |
+
help='Destination path (default: /home/luigi/rts/qwen2.5-coder-1.5b-instruct-q4_0.gguf)'
|
| 125 |
)
|
| 126 |
|
| 127 |
args = parser.parse_args()
|
|
|
|
| 145 |
else:
|
| 146 |
print()
|
| 147 |
print("❌ Setup failed. Please try again or download manually from:")
|
| 148 |
+
print(" https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF")
|
| 149 |
sys.exit(1)
|
| 150 |
|
| 151 |
|