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

refactor model trait method signatures #26

Merged
merged 21 commits into from
Apr 8, 2024

Conversation

jorgeantonio21
Copy link
Contributor

@jorgeantonio21 jorgeantonio21 commented Apr 6, 2024

This longer PR addresses the following:

  • A few bugs on the implementations of each supported models.
  • Refactors the ModelTrait methods into something that seems more compatible and less verbose.
  • Long refactor on the StableDiffusion model, to decouple loading the unet, vae and text embedding models from running inference.
  • Makes the ModelService general enough to support multiple thread models, without being stucked with a single model (enforced previously by the M: ModelTrait associated type).

@jorgeantonio21 jorgeantonio21 changed the title [wip] refactor model trait method signatures refactor model trait method signatures Apr 7, 2024
@jorgeantonio21 jorgeantonio21 mentioned this pull request Apr 7, 2024
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum ModelType {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like the idea that model type is inside the models models. Models should just know their version. They shouldn't be aware of any other model, but with this structure they are. Enum of enums would be a better solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with this. Let's merge this PR and address this issue in a future PR.

@Cifko
Copy link
Collaborator

Cifko commented Apr 8, 2024

It would be nice if you split PRs like these. The review is getting messy when unrelated things are combined into a single PR.

@jorgeantonio21 jorgeantonio21 merged commit 74b88a4 into main Apr 8, 2024
1 check passed
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.

2 participants