-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
55 lines (45 loc) · 1.3 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import torch
from utilities.util import print_header, select
from ingestion import ingest_main
from oasis import oasis_main
def gpu_status():
if torch.cuda.is_available():
print(f"Cuda GPU: {torch.cuda.get_device_name(0)} is Available.")
else:
print("Cuda GPU Not Available.")
input("Press Enter to continue...")
def configuration():
"""
Present the current configuration for the model and ingestion process (Loaded from .env)
Example parameters:
- Model
- Ingestion Directory
- Number of files in ingestion directory
- Chunk Size3
- Chun k Overlap
:return:
"""
pass
def main(first_run=None):
"""
Main function for the Oasis Toolkit
:return:
"""
while True:
if not first_run:
# Clear the console
print("\033[H\033[J")
first_run = False
print_header("The Oasis Toolkit")
functions = {
"Document Ingestion": ingest_main,
"Query": oasis_main,
"Config": configuration,
"GPU Status": gpu_status,
}
# Call the select method and run the selected function
choice = select([*functions.keys()])
functions[choice]()
#
if __name__ == "__main__":
main(first_run=True)