Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running ingest.py #26

Open
jmlongriver12 opened this issue Mar 9, 2023 · 3 comments · May be fixed by #49
Open

Error when running ingest.py #26

jmlongriver12 opened this issue Mar 9, 2023 · 3 comments · May be fixed by #49

Comments

@jmlongriver12
Copy link

I got an error as below when running "python ingest.py"
langchain/vectorstores/faiss.py", line 251, in from_texts
index = faiss.IndexFlatL2(len(embeddings[0]))
IndexError: list index out of range

Could you please help on it, thanks!

@vcidst
Copy link

vcidst commented Mar 28, 2023

That implies the document loader isn't either right or there's nothing for it to load. You should check for both

@Jeru2023
Copy link

Jeru2023 commented Apr 5, 2023

You can replace the loader with unstructured url loader:

from langchain.document_loaders import UnstructuredURLLoader

def ingest_docs():
"""Get documents from web pages."""
loader = UnstructuredURLLoader(urls=["https://python.langchain.com/en/latest/"])
raw_documents = loader.load()

@bigsky77
Copy link

bigsky77 commented Apr 7, 2023

This works awesome! Solved it on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants