File size: 1,226 Bytes
5db30ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import click

from elbench.basic_education_runtime.langchain_compat import set_debug

from elbench.basic_education_runtime.cli.generate import generate, generate_logic
from elbench.basic_education_runtime.cli.eval import eval, eval_logic
from elbench.basic_education_runtime.cli.visualize import visualize
from elbench.basic_education_runtime.cli.draw import draw
from elbench.basic_education_runtime.cli.export import export
from elbench.basic_education_runtime.cli.export.json_ import export_json_logic


@click.command(
    help="Run the pipeline to generate, export JSON files, and evaluate the results."
)
@click.option(
    "--config", type=click.Path(exists=True), help="Path to the configuration file"
)
@click.option("--debug", is_flag=True, help="Enable debug mode")
def pipeline(config, debug=False):
    set_debug(debug)
    from elbench.basic_education_runtime.config import load_conf

    load_conf(config)
    generate_logic()
    export_json_logic()
    eval_logic(avg=True)


@click.group()
def main():
    pass


main.add_command(generate)
main.add_command(export)
main.add_command(eval)
main.add_command(pipeline)

main.add_command(visualize)

main.add_command(draw)


if __name__ == "__main__":
    main()