Find answers from the community

Home
Members
aegon_targareyen
a
aegon_targareyen
Offline, last seen 3 months ago
Joined September 25, 2024
Hi I have 2 problems.
1.I was trying to use mistral from ollama locally, the model was downloaded, yet service context the trying to connect via API

llm = Ollama(model="mistral", request_timeout=30.0)


callback_manager = CallbackManager([LlamaDebugHandler()])
service_context = ServiceContext.from_defaults(
llm=llm, callback_manager=callback_manager, chunk_size=256,
embed_model="local")


File ~/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py:84 in map_httpcore_exceptions
raise mapped_exc(message) from exc

ConnectError: [Errno 61] Connection refused

  1. Using FAISS for indexing

create faiss index

d = 100
faiss_index = faiss.IndexFlatL2(d)

construct vector store

vector_store = FaissVectorStore(faiss_index)

while trying to test some wiki articles for indexing

add documents to index

for wiki_title in wiki_titles:
index.insert(docs_dict[wiki_title])

getting
File ~/anaconda3/lib/python3.11/site-packages/faiss/class_wrappers.py:228 in replacement_add
assert d == self.d

AssertionError

is this normal?

Please help with guidance if you have any. Thanks in advance
17 comments
W
a
Hi for Structured Retrieval using Auto retrival
In the demo weaviate db is used.

nodes = retriever.retrieve(
"Tell me about the childhood of a popular sports celebrity in the United"
" States"
)

INFO:llama_index.indices.vector_store.retrievers.auto_retriever.auto_retriever:Using query str: childhood of a popular sports celebrity
Using query str: childhood of a popular sports celebrity
INFO:llama_index.indices.vector_store.retrievers.auto_retriever.auto_retriever:Using filters: {'category': 'Sports', 'country': 'United States'}
Using filters: {'category': 'Sports', 'country': 'United States'}
INFO:llama_index.indices.vector_store.retrievers.auto_retriever.auto_retriever:Using top_k: 2
Using top_k: 2

the retrieval automatically filters sports and country from the meta data.

I tried to replicate the same using deeplake indexing

response = query_engine.query(
"Tell me about a celebrity from the United States"
)

INFO:httpx:HTTP Request: POST http://localhost:11434/api/chat "HTTP/1.1 200 OK"
HTTP Request: POST http://localhost:11434/api/chat "HTTP/1.1 200 OK"
INFO:llama_index.indices.vector_store.retrievers.auto_retriever.auto_retriever:Using query str: celebrity from United States
Using query str: celebrity from United States
INFO:llama_index.indices.vector_store.retrievers.auto_retriever.auto_retriever:Using filters: []
Using filters: []

the retriever is unable to identify the filters. is it because of change in db. Please suggest me other local indexer for structured retrieval.

Thanks
2 comments
a
W
Hi Is there any complete doc regarding structural hierarchical retriever? Is it mandatory to have meta data filters? any document regarding metadata filter would be useful.

testing the example from llama index

wiki_titles = ["Michael Jordan", "Elon Musk", "Richard Branson", "Rihanna"]
wiki_metadatas = {
"Michael Jordan": {
"category": "Sports",
"country": "United States",
},
"Elon Musk": {
"category": "Business",
"country": "United States",
},
"Richard Branson": {
"category": "Business",
"country": "UK",
},
"Rihanna": {
"category": "Music",
"country": "Barbados",
},
}
....................

vector_store_info = VectorStoreInfo(
content_info="brief biography of celebrities",
metadata_info=[
MetadataInfo(
name="category",
type="str",
description=(
"Category of the celebrity, one of [Sports, Entertainment,"
" Business, Music]"
),
),
MetadataInfo(
name="country",
type="str",
description=(
"Country of the celebrity, one of [United States, Barbados,"
" Portugal]"
),
),
],
)

in the above case if I didnt specify any metadata filter , will it used for the retriever or not ,please clarify.

Thanks
1 comment
L