File size: 1,406 Bytes
8677815
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
import argparse
from hay.retriever import generate_docs
from hay.pipeline import rg_pipeline, rs_pipeline
from app import application


def main():
    parser = argparse.ArgumentParser()

    parser.add_argument(
        '--docs', dest='docs',
        action = 'store_true'
    )

    parser.add_argument(
        '--rgpipeline', dest='rgpipeline',
        action = 'store_true'
    )

    parser.add_argument(
        '--rspipeline', dest='rspipeline',
        action='store_true'
    )

    parser.add_argument(
        '--gradio', dest='gradio',
        action='store_true'
    )

    args = parser.parse_args()

    if args.docs:
        '''
        Use this argument to generate the docs and store in DOCUMENT format
        '''
        generate_docs(overlap=10, length=100)

    if args.rgpipeline:
        '''
        Use this argument to run the base retriever generator pipeline
        '''
        question = "How to reduce emissions?"
        rg_pipeline(question)

    if args.rspipeline:
        '''
        Use this argument to run the retriever summarizer pipeline
        '''

        question = "How to reduce emissions in last mile supply chain?"
        answer = rs_pipeline(question)     
        print(answer)

    if args.gradio:
        '''
        Use this argument to run the application
        '''   
        application()

    return None


if __name__ == '__main__':
    main()