mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-06 11:05:26 +00:00
22 lines
564 B
Python
22 lines
564 B
Python
|
|
from .generator import GeneratorLLM
|
|
|
|
class LlamacppLLM(GeneratorLLM):
|
|
from llama_cpp import Llama
|
|
|
|
def __init__(self):
|
|
"""
|
|
Handle generation using llama.cpp
|
|
"""
|
|
super().__init__()
|
|
self.llm = Llama.from_pretrained(
|
|
repo_id=self.model,
|
|
filename="*q8_0.gguf",
|
|
verbose=True
|
|
)
|
|
|
|
def generate(self, history):
|
|
self.logger.info(f"Using {self.model} for generation with Llama.cpp")
|
|
self.llm.create_chat_completion(
|
|
messages = history
|
|
) |