Migrate to uv; fix clippings paths and wrapper

This commit is contained in:
Eric Furst 2026-06-08 07:53:34 -04:00
commit 4df608c440
7 changed files with 5137 additions and 7 deletions

View file

@ -15,6 +15,13 @@
# libraries, because huggingface_hub.constants evaluates HF_HUB_OFFLINE
# at import time.
import os
from pathlib import Path
# This script lives in clippings_search/ but uses ./ paths relative to the
# project root (./models, ./clippings, ./clippings_search/store_clippings).
# Anchor the CWD to the project root so it works no matter where it's invoked from.
os.chdir(Path(__file__).resolve().parent.parent)
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["SENTENCE_TRANSFORMERS_HOME"] = "./models"
os.environ["HF_HUB_OFFLINE"] = "1"
@ -30,7 +37,6 @@ from llama_index.core import (
from llama_index.vector_stores.chroma import ChromaVectorStore
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.core.node_parser import SentenceSplitter
from pathlib import Path
import argparse
import datetime
import time

View file

@ -11,6 +11,13 @@
# libraries, because huggingface_hub.constants evaluates HF_HUB_OFFLINE
# at import time.
import os
from pathlib import Path
# This script lives in clippings_search/ but uses ./ paths relative to the
# project root (./models, ./clippings_search/store_clippings). Anchor the CWD
# to the project root so it works no matter where it's invoked from.
os.chdir(Path(__file__).resolve().parent.parent)
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["SENTENCE_TRANSFORMERS_HOME"] = "./models"
os.environ["HF_HUB_OFFLINE"] = "1"