eduai / models /llm_model.py
Shreesha-2011's picture
Deploy EduAI backend - LLM + TTS + RAG + 15 maths chapters
1d9dc1f
Raw
History Blame Contribute Delete
397 Bytes
import ctypes
from pathlib import Path
import llama_cpp
from llama_cpp import Llama
@llama_cpp.llama_log_callback
def quiet_llama_log(level, text, user_data):
return
def create_llm(model_path, context_size):
llama_cpp.llama_log_set(quiet_llama_log, ctypes.c_void_p())
return Llama(
model_path=str(Path(model_path)),
n_ctx=context_size,
verbose=False
)