Skip to content

Conversation

ianbulovic
Copy link
Contributor

The primary goal of this PR is to unify the way we load different types of models, to minimize special-casing and simplify workflows where we want to compare different model types. Now all of our model types can be loaded with AutoModel.from_pretrained(), including CNN and LSTM models. Creating a new model is also standardized now—see the example notebook for drug review sentiment classification for a step-by-step training guide supporting all four model types.

REST APIs

Our new model loading system solves the main issue with #239, where there was no obvious way to support loading different types of models. As such, this PR incorporates the changes in #239, but supporting all model types.

Updated arguments system and CLI

Now that every model has its own config class, it's redundant to also have a CnlpModelArgs dataclass. Additionally, the CnlpDataArgs class was only really being used to initialize a CnlpDataset. Both of these arguments dataclasses have been removed in this PR.

The only thing those dataclasses were really useful for is having everything in one place for the CLI... but the UX of the existing CLI was... lacking. Since the args classes were being removed anyway, I took the opportunity to switch to typer for our CLI. Here's a before and after of what it looks like running cnlpt train --help: Before | After

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.

1 participant