💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update LLM pipeline to support GPU parameter with llama.cpp backend, closes #724
davidmezzettib3a99f019785
diff --git a/src/python/txtai/pipeline/llm/llama.py b/src/python/txtai/pipeline/llm/llama.pyindex dea052b4..e590e4ad 100644--- a/src/python/txtai/pipeline/llm/llama.py+++ b/src/python/txtai/pipeline/llm/llama.py@@ -45,6 +45,9 @@ class LlamaCpp(Generation):# Check if this is a local path, otherwise download from the HF Hubpath = path if os.path.exists(path) else self.download(path)+ # Default GPU layers if not already set+ kwargs["n_gpu_layers"] = kwargs.get("n_gpu_layers", -1 if kwargs.get("gpu", True) else 0)+# Create llama.cpp instanceself.llm = Llama(path, verbose=kwargs.pop("verbose", False), **kwargs)