Skip to content

Commit

Permalink
fix: change default tasks_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweize1998 committed Oct 10, 2023
1 parent eee16bc commit c460218
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 26 deletions.
11 changes: 8 additions & 3 deletions agentverse_command/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
parser = ArgumentParser()

parser.add_argument("--task", type=str, default="tasksolving/responsegen")
parser.add_argument("--tasks_dir", type=str, default=os.path.join(
os.path.dirname(__file__), "agentverse", "tasks"))
parser.add_argument(
"--tasks_dir",
type=str,
default=os.path.join(os.path.dirname(__file__), "..", "agentverse", "tasks"),
)
parser.add_argument("--dataset_path", type=str, required=True)
parser.add_argument("--output_path", type=str, default=None)
parser.add_argument("--has_tools", action="store_true")
Expand All @@ -31,6 +34,7 @@
def get_dataloader(task, dataset_path):
return dataloader_registry.build(task, path=dataset_path)


def cli_main():
dataloader = get_dataloader(args.task, args.dataset_path)
if args.output_path is None:
Expand Down Expand Up @@ -78,5 +82,6 @@ def cli_main():
f.flush()
f.close()


if __name__ == "__main__":
cli_main()
cli_main()
11 changes: 8 additions & 3 deletions agentverse_command/main_simulation_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@

parser = ArgumentParser()
parser.add_argument("--task", type=str, default="simulation/prisoner_dilemma")
parser.add_argument("--tasks_dir", type=str, default=os.path.join(
os.path.dirname(__file__), "agentverse", "tasks"))
parser.add_argument(
"--tasks_dir",
type=str,
default=os.path.join(os.path.dirname(__file__), "..", "agentverse", "tasks"),
)
parser.add_argument("--debug", action="store_true")
args = parser.parse_args()

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


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


if __name__ == "__main__":
cli_main()
cli_main()
9 changes: 7 additions & 2 deletions agentverse_command/main_simulation_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

parser = ArgumentParser()
parser.add_argument("--task", type=str, default="simulation/nlp_classroom_9players")
parser.add_argument("--tasks_dir", type=str, default=os.path.join(
os.path.dirname(__file__), "agentverse", "tasks"))
parser.add_argument(
"--tasks_dir",
type=str,
default=os.path.join(os.path.dirname(__file__), "..", "agentverse", "tasks"),
)
args = parser.parse_args()


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


if __name__ == "__main__":
cli_main()
14 changes: 11 additions & 3 deletions agentverse_command/main_tasksolving_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import logging

# from agentverse.agentverse import AgentVerse
Expand All @@ -11,16 +12,23 @@
parser.add_argument(
"--task",
type=str,
default="tasksolving/pipeline_brainstorming",
default="tasksolving/brainstorming",
)
parser.add_argument("--debug", action="store_true")
parser.add_argument(
"--tasks_dir",
type=str,
default=os.path.join(os.path.dirname(__file__), "..", "agentverse", "tasks"),
)
args = parser.parse_args()

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


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


if __name__ == "__main__":
cli_main()
cli_main()
31 changes: 16 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from setuptools.command.develop import develop
import subprocess

# with open("requirements.txt", "r") as f:
# requirements = f.read().splitlines()
with open("requirements.txt", "r") as f:
requirements = f.read().splitlines()

with open("README.md", "r", encoding='utf8') as fh:
long_description = fh.read()
Expand All @@ -24,19 +24,20 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9",
install_requires=[
"PyYAML",
"fastapi",
"uvicorn",
"py3langid",
"iso-639",
"openai",
"opencv-python",
"gradio",
"httpx[socks]",
"astunparse",
"langchain",
],
# install_requires=[
# "PyYAML",
# "fastapi",
# "uvicorn",
# "py3langid",
# "iso-639",
# "openai",
# "opencv-python",
# "gradio",
# "httpx[socks]",
# "astunparse",
# "langchain",
# ],
install_requires=requirements,
include_package_data = True,
entry_points={
"console_scripts": [
Expand Down

0 comments on commit c460218

Please sign in to comment.