sinhal commited on
Commit
f1ee8ea
·
verified ·
1 Parent(s): 2a8e1de

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -52,8 +52,12 @@ else:
52
  print("Initializing Llama model...")
53
  llm = Llama(
54
  model_path=model_path,
55
- n_ctx=2048,
56
- n_threads=2 # Optimize for HF CPU Space (2 vCPUs)
 
 
 
 
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