mirror of
https://github.com/Nighthawk42/VDM.git
synced 2026-08-30 04:30:21 +00:00
Fixes.
This commit is contained in:
@@ -19,7 +19,6 @@ from .config import settings
|
||||
from .logger import logger
|
||||
|
||||
# This block is for static analysis only (for Pylance).
|
||||
# It is not executed at runtime, so it won't cause an ImportError.
|
||||
if TYPE_CHECKING:
|
||||
from chonkie import SemanticChunker
|
||||
from chonkie.embeddings import SentenceTransformerEmbeddings
|
||||
@@ -70,7 +69,11 @@ class MemoryManager:
|
||||
raise ImportError("Chonkie is configured but not installed correctly. Please run 'uv pip install \"chonkie[st]\"'.")
|
||||
|
||||
logger.info("Initializing Chonkie with SemanticChunker...")
|
||||
embedding_handler = SentenceTransformerEmbeddings(model_name=settings.memory.embedding_model, device="cpu")
|
||||
# FIXED: Changed keyword from 'model_name' to 'model'
|
||||
embedding_handler = SentenceTransformerEmbeddings(
|
||||
model=settings.memory.embedding_model,
|
||||
device="cpu"
|
||||
)
|
||||
self.chunker = SemanticChunker(embedding_model=embedding_handler)
|
||||
self.embedder = embedding_handler
|
||||
logger.info("Using 'chonkie' for text chunking.")
|
||||
@@ -107,9 +110,8 @@ class MemoryManager:
|
||||
if not text or not text.strip(): return
|
||||
try:
|
||||
if settings.memory.chunker == "chonkie" and self.chunker:
|
||||
# The runtime code knows what self.chunker(text) returns
|
||||
chonkie_chunks = self.chunker(text)
|
||||
chunks = [c.text for c in chonkie_chunks if c.text.strip()] # type: ignore (This might break, we're see)
|
||||
chunks = [c.text for c in chonkie_chunks if c.text.strip()] # type: ignore (This *might* break things)
|
||||
else:
|
||||
chunks = self._simple_chunker(text)
|
||||
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ llm:
|
||||
# The model identifier for the chosen backend.
|
||||
# Example for OpenRouter: "google/gemma-2-9b-it"
|
||||
# Example for LM Studio: "gemma-2-9b-it-gguf" (or whatever you have loaded)
|
||||
story_model: "google/gemma-3n-e4b"
|
||||
story_model: "gemma-3-12b-it-GGUF"
|
||||
|
||||
# The format for sending player actions to the AI.
|
||||
# "json": (Recommended) More reliable and less ambiguous for modern models.
|
||||
@@ -62,7 +62,7 @@ audio:
|
||||
memory:
|
||||
# The chunking strategy to use for breaking down text for the RAG system.
|
||||
# Options: "simple" (original method), "chonkie" (advanced library).
|
||||
chunker: "simple"
|
||||
chunker: "chonkie"
|
||||
|
||||
# The SentenceTransformer model used to create embeddings for the AI's
|
||||
embedding_model: "google/embeddinggemma-300m"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user