Skip to content

Commit

Permalink
fix: complete the command line for agentverse's demos to make it more…
Browse files Browse the repository at this point in the history
… convenient for users to use
  • Loading branch information
minleminzui committed Oct 10, 2023
1 parent 8107ee4 commit 1ffa91b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }}
run: |
python benchmark.py --task tasksolving/mgsm/gpt-3.5 --dataset_path data/mgsm/test_sample.jsonl --overwrite --output_path ci_smoke_test_output
python setup.py develop
python agentverse_command/benchmark.py --task tasksolving/mgsm/gpt-3.5 --dataset_path data/mgsm/test_sample.jsonl --overwrite --output_path ci_smoke_test_output --tasks_dir ./agentverse/tasks
python evaluate_math.py --path ci_smoke_test_output/results.jsonl --ci_smoke_test
Empty file added agentverse_command/__init__.py
Empty file.
6 changes: 4 additions & 2 deletions benchmark.py → agentverse_command/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
def get_dataloader(task, dataset_path):
return dataloader_registry.build(task, path=dataset_path)


if __name__ == "__main__":
def cli_main():
dataloader = get_dataloader(args.task, args.dataset_path)
if args.output_path is None:
os.makedirs(f"./results/{args.task}", exist_ok=True)
Expand Down Expand Up @@ -78,3 +77,6 @@ def get_dataloader(task, dataset_path):
)
f.flush()
f.close()

if __name__ == "__main__":
cli_main()
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@

logger.set_level(logging.DEBUG if args.debug else logging.INFO)

agentverse = Simulation.from_task(args.task, args.tasks_dir)
agentverse.run()
def cli_main():
agentverse = Simulation.from_task(args.task, args.tasks_dir)
agentverse.run()

if __name__ == "__main__":
cli_main()
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
os.path.dirname(__file__), "agentverse", "tasks"))
args = parser.parse_args()

ui = GUI(args.task, args.tasks_dir)
ui.launch()
def cli_main():
ui = GUI(args.task, args.tasks_dir)
ui.launch()

if __name__ == "__main__":
cli_main()
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@

logger.set_level(logging.DEBUG if args.debug else logging.INFO)

agentversepipeline = TaskSolving.from_task(args.task)
agentversepipeline.run()
def cli_main():
agentversepipeline = TaskSolving.from_task(args.task)
agentversepipeline.run()

if __name__ == "__main__":
cli_main()
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@
"langchain",
],
include_package_data = True,
entry_points={
"console_scripts": [
"agentverse-benchmark = agentverse_command.benchmark:cli_main",
"agentverse-main_simulation_cli = agentverse_command.main_simulation_cli:cli_main",
"agentverse-main_simulation_gui = agentverse_command.main_simulation_gui:cli_main",
"agentverse-main_tasksolving_cli = agentverse_command.main_tasksolving_cli:cli_main",
],
},
)

0 comments on commit 1ffa91b

Please sign in to comment.