-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (21 loc) · 721 Bytes
/
main.py
File metadata and controls
26 lines (21 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys, os
from gpt_index import GPTSimpleVectorIndex
from dotenv import load_dotenv
load_dotenv()
index = GPTSimpleVectorIndex.load_from_disk('index.json')
should_continue = True
while should_continue:
query = input("Ask me anything about Atlas App Services:\n")
print('\nwait a bit. i\'m thinking really hard...')
sys.stdout = open(os.devnull, "w") # suppress output to terminal
res = index.query(query)
sys.stdout = sys.__stdout__ # restore output to terminal
print(res)
print('\n\n')
do_continue = input('Any other questions? Press <enter> to continue.')
if do_continue == '':
print('\n\n')
continue
else:
print('Exiting application. Byeeeee! :)')
should_continue = False