Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -52,8 +52,12 @@ else:
|
|
| 52 |
print("Initializing Llama model...")
|
| 53 |
llm = Llama(
|
| 54 |
model_path=model_path,
|
| 55 |
-
n_ctx=
|
| 56 |
-
n_threads=2
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
)
|
| 58 |
print("Llama model initialized successfully!")
|
| 59 |
|
|
|
|
| 52 |
print("Initializing Llama model...")
|
| 53 |
llm = Llama(
|
| 54 |
model_path=model_path,
|
| 55 |
+
n_ctx=1024, # Halved context size for faster history processing on CPU
|
| 56 |
+
n_threads=2, # Thread-capped to prevent Docker CPU throttling
|
| 57 |
+
n_batch=256, # Optimized batch size for CPU Cache
|
| 58 |
+
use_mmap=False, # Eagerly loads model into memory during startup (eliminating lazy disk reads)
|
| 59 |
+
type_k=7, # Quantizes KV cache keys to Q8_0 (GGML_TYPE_Q8_0)
|
| 60 |
+
type_v=7 # Quantizes KV cache values to Q8_0 (GGML_TYPE_Q8_0)
|
| 61 |
)
|
| 62 |
print("Llama model initialized successfully!")
|
| 63 |
|