Zack Saadioui
8/26/2024
1 2
pip install -q llama-index llama-index-packs-raptor llama-index-vector-stores-qdrant pip install -q llama-index-vector-stores-chroma
1 2 3
from llama_index.core import SimpleDirectoryReader documents = SimpleDirectoryReader(input_files=["<file path>" ]).load_data()
1 2 3 4 5 6 7 8 9 10 11 12 13 14
from llama_index.packs.raptor import RaptorPack from llama_index.embeddings.openai import OpenAIEmbedding client = chromadb.PersistentClient(path="./raptor_paper_db") collection = client.get_or_create_collection("raptor") vectore_store = ChromaVectorStore(chroma_collection=collection) raptor_pack = RaptorPack(documents, embed_model=OpenAIEmbedding(model="text-embedding-3-small"), llm=OpenAI(model="gpt-3.5-turbo", temperature=0.1), vector_store=vector_store, similarity_top_k=2, mode="collapsed", transformations=[SentenceSplitter(chunk_size=400, chunk_overlap=50)])
Copyright © Arsturn 2024