Gemma34B / app /model_loader.py
VietCat's picture
update dynamic max_ctx
37f2c10
raw
history blame contribute delete
344 Bytes
from llama_cpp import Llama
def load_model(model_path: str):
n_ctx = 2048 # bạn có thể điều chỉnh tùy theo mô hình
llm = Llama(
model_path=model_path,
n_ctx=n_ctx,
n_threads=4,
n_gpu_layers=0,
use_mlock=False,
logits_all=False
)
return {"llm": llm, "n_ctx": n_ctx}