Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,14 +2,12 @@ import json
|
|
| 2 |
import streamlit as st
|
| 3 |
from gpt_index import GPTSimpleVectorIndex
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
# Define the app layout
|
| 8 |
st.title('GPT Search')
|
| 9 |
query = st.text_input('Enter a query:')
|
| 10 |
if query:
|
| 11 |
-
result =
|
| 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)
|
|
|
|
|
|
|
|
|