-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" | |
[tool.poetry] # https://python-poetry.org/docs/pyproject/ | ||
name = "raglite" | ||
version = "0.0.0" | ||
description = "A RAG extension for SQLite." | ||
description = "A Python package for Retrieval-Augmented Generation (RAG) with SQLite." | ||
authors = ["Laurent Sorber <[email protected]>"] | ||
readme = "README.md" | ||
repository = "https://github.com/radix-ai/raglite" | ||
|
@@ -123,55 +123,7 @@ src = ["src", "tests"] | |
target-version = "py310" | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"A", | ||
"ASYNC", | ||
"B", | ||
"BLE", | ||
"C4", | ||
"C90", | ||
"D", | ||
"DTZ", | ||
"E", | ||
"EM", | ||
"ERA", | ||
"F", | ||
"FBT", | ||
"FLY", | ||
"FURB", | ||
"G", | ||
"I", | ||
"ICN", | ||
"INP", | ||
"INT", | ||
"ISC", | ||
"LOG", | ||
"N", | ||
"NPY", | ||
"PERF", | ||
"PGH", | ||
"PIE", | ||
"PL", | ||
"PT", | ||
"PTH", | ||
"PYI", | ||
"Q", | ||
"RET", | ||
"RSE", | ||
"RUF", | ||
"S", | ||
"SIM", | ||
"SLF", | ||
"SLOT", | ||
"T10", | ||
"T20", | ||
"TCH", | ||
"TID", | ||
"TRY", | ||
"UP", | ||
"W", | ||
"YTT", | ||
] | ||
select = ["A", "ASYNC", "B", "BLE", "C4", "C90", "D", "DTZ", "E", "EM", "ERA", "F", "FBT", "FLY", "FURB", "G", "I", "ICN", "INP", "INT", "ISC", "LOG", "N", "NPY", "PERF", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "Q", "RET", "RSE", "RUF", "S", "SIM", "SLF", "SLOT", "T10", "T20", "TCH", "TID", "TRY", "UP", "W", "YTT"] | ||
ignore = ["D203", "D213", "E501", "RET504", "RUF002", "S101", "S307"] | ||
unfixable = ["ERA001", "F401", "F841", "T201", "T203"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Fixtures for the tests.""" | ||
|
||
import pytest | ||
from llama_cpp import Llama, LlamaRAMCache # type: ignore[attr-defined] | ||
|
||
from raglite import RAGLiteConfig | ||
|
||
|
||
@pytest.fixture() | ||
def simple_config() -> RAGLiteConfig: | ||
"""Create a lightweight in-memory config for testing.""" | ||
# Use a lightweight LLM. | ||
llm = Llama.from_pretrained( | ||
repo_id="bartowski/Phi-3.1-mini-4k-instruct-GGUF", # https://huggingface.co/microsoft/Phi-3-mini-4k-instruct | ||
filename="*Q4_K_M.gguf", | ||
n_ctx=4096, # 0 = Use the model's context size (default is 512). | ||
n_gpu_layers=-1, # -1 = Offload all layers to the GPU (default is 0). | ||
verbose=False, | ||
) | ||
llm.set_cache(LlamaRAMCache()) | ||
# Use a lightweight embedder. | ||
embedder = Llama.from_pretrained( | ||
repo_id="ChristianAzinn/snowflake-arctic-embed-xs-gguf", # https://github.com/Snowflake-Labs/arctic-embed | ||
filename="*f16.GGUF", | ||
n_ctx=0, # 0 = Use the model's context size (default is 512). | ||
n_gpu_layers=-1, # -1 = Offload all layers to the GPU (default is 0). | ||
verbose=False, | ||
embedding=True, | ||
) | ||
# Use an in-memory SQLite database. | ||
db_url = "sqlite:///:memory:" | ||
# Create the config. | ||
config = RAGLiteConfig(llm=llm, embedder=embedder, db_url=db_url) | ||
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters