llama_new_context_with_model: n_ctx_per_seq (3904) < n_ctx_train (32768) -- the full capacity of the model will not be utilized
data = [ # from txtai"US tops 5 million confirmed virus cases","Canada's last fully intact ice shelf has suddenly collapsed, forming a Manhattan-sized iceberg","Beijing mobilises invasion craft along coast as Taiwan tensions escalate","The National Park Service warns against sacrificing slower friends in a bear attack","Maine man wins $1M from $25 lottery ticket","Make huge profits without work, earn up to $100,000 a day",]source_folder = tempfile.mkdtemp()for i, d inenumerate(data): filename = os.path.join(source_folder, f"doc{i}.txt")withopen(filename, "w") as f: f.write(d)
Ingestion complete! You can now query your documents using the LLM.ask or LLM.chat methods
Here, we get a reference to the underlying vector store and query it directly to find the best semantic match.
vs = llm.load_vectorstore()for query in ("feel good story","climate change","public health story","war","wildlife","asia","lucky","dishonest junk",): docs = vs.query(query)print(f"{query} : {docs[0].page_content}")
feel good story : Maine man wins $1M from $25 lottery ticket
climate change : Canada's last fully intact ice shelf has suddenly collapsed, forming a Manhattan-sized iceberg
public health story : US tops 5 million confirmed virus cases
war : Beijing mobilises invasion craft along coast as Taiwan tensions escalate
wildlife : The National Park Service warns against sacrificing slower friends in a bear attack
asia : Beijing mobilises invasion craft along coast as Taiwan tensions escalate
lucky : Maine man wins $1M from $25 lottery ticket
dishonest junk : Make huge profits without work, earn up to $100,000 a day