Find answers from the community

Updated 3 months ago

Syntax error

not running any debugger. Context is the following:
  1. Goal of trying to get LlamaIndex up an running and to run a successful query
  2. Git cloned https://github.com/jerryjliu/llama_index
  3. Navigated to llama_index/examples/paul_graham_essay
  4. Created py file per instructions here: https://gpt-index.readthedocs.io/en/latest/getting_started/starter_example.html. py file is in the paul_graham_essay directory
  5. Ran response = index.query("What did the author do growing up?")
print(response)
  1. Got syntax error
L
3 comments
Right, but the syntax error is probably pointing to a particular line or file πŸ‘

Makes it easier to debug once we know the line that has the error πŸ’ͺ
As far as I can tell, your code should be working

Plain Text
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader

documents = SimpleDirectoryReader('./data').load_data()
index = GPTSimpleVectorIndex.from_documents(documents)
(You might have better luck installing from pypi rather than source pip install --upgrade llama_index)
Add a reply
Sign up and join the conversation on Discord