Mattdoc99 commited on
Commit
182fbe6
·
1 Parent(s): 91b8fd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -2,14 +2,12 @@ import json
2
  import streamlit as st
3
  from gpt_index import GPTSimpleVectorIndex
4
 
5
- search_gpt_index = GPTSimpleVectorIndex.load_from_disk('index-4.json')
 
6
 
7
  # Define the app layout
8
  st.title('GPT Search')
9
  query = st.text_input('Enter a query:')
10
  if query:
11
- result = gpt_index.query(query)
12
- st.write(result)
13
-
14
- if __name__ == '__main__':
15
- search_gpt_index()
 
2
  import streamlit as st
3
  from gpt_index import GPTSimpleVectorIndex
4
 
5
+ # Load the index from disk
6
+ index = GPTSimpleVectorIndex.load_from_disk('index.json')
7
 
8
  # Define the app layout
9
  st.title('GPT Search')
10
  query = st.text_input('Enter a query:')
11
  if query:
12
+ result = index.query(query)
13
+ st.write(result)