Spaces:
Running
Running
perf: switch to Qwen 2.5 Coder 1.5B for ultra-fast inference on 2 vCPU hardware
Browse files- model_service.py +5 -5
model_service.py
CHANGED
|
@@ -3,10 +3,10 @@ from llama_cpp import Llama
|
|
| 3 |
from huggingface_hub import hf_hub_download
|
| 4 |
|
| 5 |
# --- Configuration ---
|
| 6 |
-
# Using the 4-bit quantized version of Qwen 2.5 Coder
|
| 7 |
-
# This
|
| 8 |
-
REPO_ID = "Qwen/Qwen2.5-Coder-
|
| 9 |
-
FILENAME = "qwen2.5-coder-
|
| 10 |
|
| 11 |
print(f"Initializing Clarity AI Engine (llama.cpp)...")
|
| 12 |
print(f"Target Model: {REPO_ID} [{FILENAME}]")
|
|
@@ -167,7 +167,7 @@ def correct_code_with_ai(code: str) -> dict:
|
|
| 167 |
# llama-cpp-python chat completion
|
| 168 |
response = llm.create_chat_completion(
|
| 169 |
messages=messages,
|
| 170 |
-
max_tokens=1024, #
|
| 171 |
temperature=0.1, # Lower temperature for stricter adherence
|
| 172 |
)
|
| 173 |
|
|
|
|
| 3 |
from huggingface_hub import hf_hub_download
|
| 4 |
|
| 5 |
# --- Configuration ---
|
| 6 |
+
# Using the 4-bit quantized version of Qwen 2.5 Coder 1.5B
|
| 7 |
+
# This is the fastest option for 2 vCPU hardware while maintaining good coding intelligence.
|
| 8 |
+
REPO_ID = "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF"
|
| 9 |
+
FILENAME = "qwen2.5-coder-1.5b-instruct-q4_k_m.gguf"
|
| 10 |
|
| 11 |
print(f"Initializing Clarity AI Engine (llama.cpp)...")
|
| 12 |
print(f"Target Model: {REPO_ID} [{FILENAME}]")
|
|
|
|
| 167 |
# llama-cpp-python chat completion
|
| 168 |
response = llm.create_chat_completion(
|
| 169 |
messages=messages,
|
| 170 |
+
max_tokens=1024, # Optimized for 1.5B speed
|
| 171 |
temperature=0.1, # Lower temperature for stricter adherence
|
| 172 |
)
|
| 173 |
|