DocsGPT icon indicating copy to clipboard operation
DocsGPT copied to clipboard

Error training on new docs

Open pshriwise opened this issue 2 years ago • 2 comments

Getting this error out of the gate when trying to train on a single new .rst file. Any thoughts?

Traceback (most recent call last):
  File "/home/pshriwise/soft/doc-gpt/docsgpt/scripts/ingest_rst.py", line 36, in <module>
    store = FAISS.from_texts(docs, OpenAIEmbeddings(), metadatas=metadatas)
  File "/home/pshriwise/.pyenv/versions/3.9.1/lib/python3.9/site-packages/langchain/vectorstores/faiss.py", line 192, in from_texts
    index = faiss.IndexFlatL2(len(embeddings[0]))
IndexError: list index out of range

pshriwise avatar Feb 06 '23 14:02 pshriwise

@pshriwise Could you provide the .rst file that causes the error?

bil0u avatar Feb 06 '23 17:02 bil0u

Sure thing! https://github.com/openmc-dev/openmc/blob/develop/docs/source/index.rst

pshriwise avatar Feb 06 '23 17:02 pshriwise

@pshriwise Hey Patrick,

If you haven't already, create a folder named "scikit-learn" inside the "scripts" folder and toss your index.rst inside of it. That should fix your problem.

You can really name the folder anything you would like, just make sure it matches the path in the ingest_rst.py and ingest_rst_sphinx.py files:

ps = list(Path("<FolderName>").glob("**/*.rst"))

image

jaredbradley243 avatar Feb 07 '23 02:02 jaredbradley243

Let me know if that works for you so I can close the issue. :)

jaredbradley243 avatar Feb 07 '23 02:02 jaredbradley243

It did. Thanks! I appreciate the help!

pshriwise avatar Feb 07 '23 03:02 pshriwise

No problem! Glad to help.

jaredbradley243 avatar Feb 07 '23 03:02 jaredbradley243