-
Notifications
You must be signed in to change notification settings - Fork 7
/
vanillagpt_main.py
34 lines (25 loc) · 1.02 KB
/
vanillagpt_main.py
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
27
28
29
30
31
32
33
34
from helpers.configs.configuration import Configs
from helpers.utilities.setup_environment import setup_environment
def main(user_id, debug=True, functionalities_path=None, test_queries=None):
# Get the mode from the configuration file
Configs.set_debug_mode(debug)
Configs.set_user_id(user_id)
if functionalities_path:
Configs.set_functionalities_path(functionalities_path)
# Set up all necessary environment variables and perform initializations
setup_environment()
# Initialize VanillaGPT
from vanillagpt.vanillagpt import VanillaGPT
plain_gpt = VanillaGPT()
if debug:
for query in test_queries:
plain_gpt.query_process(query)
else:
print("Message VanillaGPT (enter '/exit' to end the conversation)...")
while True:
query = input("You: ")
if query.lower() == "/exit":
break
plain_gpt.query_process(query)
if __name__ == '__main__':
main('0', debug=False)