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

Initialize components with interfaces and stub implementations #5

Merged
merged 74 commits into from
Apr 17, 2023

Conversation

viswavi
Copy link
Collaborator

@viswavi viswavi commented Apr 4, 2023

Description

Initialize all Prompt2Model components with separate interfaces and stub implementations. This PR also contains an integration test (using all the components' stub implementations) that verifies that the types of all the components fit together.

References

  • N/A

Blocked by

  • NA

@viswavi viswavi changed the title [wip] Initialize functions with unimplemented interfaces Initialize components with interfaces and stub implementations Apr 7, 2023
Copy link
Collaborator

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Thanks @viswavi ! This is looking good.

I left some comments on only the dataset generators part, but many of them are general philosophical comments that should apply throughout the codebase. Please take a look. If you agree with the comments you can reflect them, and if you don't understand or disagree with anything please follow up and we can discuss!

prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved

"""
_ = prompt_spec, num_examples, split # suppress unused variable warnings
return datasets.Dataset.from_pandas(pd.DataFrame({}))
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, it seems like a reasonable restriction that the datasets should be the same length as num_examples. This example here breaks that restriction, so maybe we should make it a dataset of appropriate length full of empty dictionaries instead?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure! 🆗

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. @zhaochenyang20 when we write unit tests for dataset_generator we should add a check that the dataset is of the same length as num_examples. I've created an issue (#7 ) to add this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I will try to create our unit test for DatasetGenerator this weekend following our new restriction. 🙂

@viswavi viswavi requested a review from neubig April 17, 2023 18:26
Copy link
Collaborator

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Looking great! I just have a few comments left, mostly on the new/changed parts.

prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/base.py Show resolved Hide resolved
prompt2model/dataset_generator/base.py Outdated Show resolved Hide resolved
prompt2model/dataset_generator/empty.py Outdated Show resolved Hide resolved
prompt2model/evaluator/base.py Show resolved Hide resolved
prompt2model/evaluator/mock.py Outdated Show resolved Hide resolved
prompt2model/model_executor/base.py Outdated Show resolved Hide resolved
prompt2model/model_executor/mock.py Show resolved Hide resolved
@viswavi viswavi requested a review from neubig April 17, 2023 23:04
Copy link
Collaborator

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Looks great now!

@viswavi viswavi merged commit 729d29a into main Apr 17, 2023
@viswavi viswavi deleted the vijay_init_stubs branch April 17, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants