Skip to content
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

Merged
merged 6 commits into from
Mar 19, 2023
Merged

Task generator #7

merged 6 commits into from
Mar 19, 2023

Conversation

hammoudhasan
Copy link
Collaborator

No description provided.

Copy link
Member

@lightaime lightaime left a 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())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is here a typo?

Suggested change
task_tuple = next(TaskPromptGenerator().generate_role_prompt())
task_tuple = next(TaskPromptGenerator(). from_role_generator())

TaskPromptGenerator)


def process_task(role_name: str, task_generator_prompt: str,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def process_task(role_name: str, task_generator_prompt: str,
def generate_tasks(role_name: str, task_generator_prompt: str,

task_generator_prompt_generator = TaskPromptGenerator().from_role_files()

pool = multiprocessing.Pool()
counter = 0
Copy link
Member

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.

@lightaime lightaime added Data Related to camel data processing Prompt Related to camel prompts Task Related to camel tasks labels Mar 19, 2023
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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pool.apply_async(process_task, (role_name, task_generator_prompt))
pool.apply_async(generate_tasks, (role_name, task_generator_prompt))

counter = 0
for task_generator_prompt, role_name in zip(
task_generator_prompt_generator, role_names_generator):
counter += 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here.

@hammoudhasan hammoudhasan merged commit 0c82e93 into master Mar 19, 2023
@hammoudhasan hammoudhasan deleted the task_generator branch March 19, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Related to camel data processing Prompt Related to camel prompts Task Related to camel tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants