-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task generator #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job. Leave a few comments about the naming.
camel/configs.py
Outdated
role_tuple = next(role_name_generator) | ||
assert isinstance(role_tuple, tuple) | ||
|
||
task_tuple = next(TaskPromptGenerator().generate_role_prompt()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is here a typo?
task_tuple = next(TaskPromptGenerator().generate_role_prompt()) | |
task_tuple = next(TaskPromptGenerator(). from_role_generator()) |
camel/task_generator.py
Outdated
TaskPromptGenerator) | ||
|
||
|
||
def process_task(role_name: str, task_generator_prompt: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def process_task(role_name: str, task_generator_prompt: str, | |
def generate_tasks(role_name: str, task_generator_prompt: str, |
camel/task_generator.py
Outdated
task_generator_prompt_generator = TaskPromptGenerator().from_role_files() | ||
|
||
pool = multiprocessing.Pool() | ||
counter = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the counter
. It does not indicate how many tasks are generated. So it is not useful.
camel/task_generator.py
Outdated
counter += 1 | ||
if not os.path.exists(f"./tasks/{'_'.join(role_name)}.txt"): | ||
print(f"Generating tasks for {role_name}") | ||
pool.apply_async(process_task, (role_name, task_generator_prompt)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pool.apply_async(process_task, (role_name, task_generator_prompt)) | |
pool.apply_async(generate_tasks, (role_name, task_generator_prompt)) |
camel/task_generator.py
Outdated
counter = 0 | ||
for task_generator_prompt, role_name in zip( | ||
task_generator_prompt_generator, role_names_generator): | ||
counter += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here.
No description provided.