Mattdoc99 commited on
Commit
63593a3
·
1 Parent(s): 945c5d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -1,14 +1,8 @@
1
- import streamlit as st
2
- from gpt_index import GPTSimpleVectorIndex
 
 
 
 
3
 
4
- # Load the GPT index from the file
5
- with open('index.json', 'r') as f:
6
- index_data = json.load(f)
7
- gpt_index = GPTSimpleVectorIndex(index_data)
8
-
9
- # Define the app layout
10
- st.title('GPT Search')
11
- query = st.text_input('Enter a query:')
12
- if query:
13
- result = gpt_index.query(query)
14
- st.write(result)
 
1
+ def ask_patrick():
2
+ index = GPTSimpleVectorIndex.load_from_disk('index.json')
3
+ while True:
4
+ query = input("Tell me about Patrick Collison?")
5
+ response = index.query(query, response_mode="compact", verbose=True)
6
+ print("\n\nAnswer says:\n\n" + response.response + "\n\n\n")
7
 
8
+ ask_patrick()