Llama_index having trouble loading JSON file

hi there

I am learning and a beginner.

this error came out of nowhere when I was debugging another part of my code. Ive spend the last 4 hours on it!

I have an index file created by gpt_index (llama_index) that was working absolutly fine, then this ‘key struct’ error appeared out of nowhere resulting in a runtime error. I have reverted to old code, reinstalled libraries, re-constructed index2.json multiple times, etc… The json file headers look fine and I can read the json file from the local cloned repo.

the issue seems to be with : GPTSimpleVectorIndex.load_from_disk(index_file_path)

I think it doesn’t like the structure of the index2.json file, but why now? and why won’t it accept new constrcutions of it if it did get corrupted?

Do you have any suggestion on how to solve this problem or what could be causing it? I would greatly appreciate any help or insight you can provide.

this is my space: https://huggingface.co/spaces/peterpull/MediatorBot/

i loaded the index file on my local machine and it runs fine, so is the issue with huggingspace.co environment?


cgmcr 2023-04-01T07:39:52.844Z index_struct = load_index_struct_from_dict(result_dict[INDEX_STRUCT_KEY])
cgmcr 2023-04-01T07:39:52.844Z KeyError: ‘index_struct’

I think I needed ‘transformers’ in requirements.txt — even though it was not referenced in my code

1 Like

adding transformers in requirements.txt solved the issue. Thank you.