Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,8 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|