# Llama\_index having trouble loading JSON file

**URL:** <https://discuss.huggingface.co/t/llama-index-having-trouble-loading-json-file/35240>\
**Category:** Beginners\
**Created:** [April 1, 2023, 7:57am UTC](https://discuss.huggingface.co/t/llama-index-having-trouble-loading-json-file/35240 "2023-04-01T07:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterpull](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/peterpull/32/15011_2.png) [@peterpull](https://discuss.huggingface.co/u/peterpull)\
**Post date:** [April 1, 2023, 7:57am UTC](https://discuss.huggingface.co/t/llama-index-having-trouble-loading-json-file/35240/1 "2023-04-01T07:57:18Z")

</div>

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/](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](http://huggingspace.co) environment?

Peter

LOG FILE ERROR:  
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’

```auto

```

---

<div class="post-metadata">

**Author:** ![peterpull](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/peterpull/32/15011_2.png) [@peterpull](https://discuss.huggingface.co/u/peterpull)\
**Post date:** [April 1, 2023, 9:16am UTC](https://discuss.huggingface.co/t/llama-index-having-trouble-loading-json-file/35240/2 "2023-04-01T09:16:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daveckw](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/daveckw/32/15273_2.png) [@daveckw](https://discuss.huggingface.co/u/daveckw)\
**Post date:** [April 8, 2023, 2:20pm UTC](https://discuss.huggingface.co/t/llama-index-having-trouble-loading-json-file/35240/3 "2023-04-08T14:20:09Z")

</div>

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