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

Fix protocol typing #197

Merged
merged 1 commit into from
Feb 8, 2024
Merged

Conversation

yelite
Copy link

@yelite yelite commented Feb 8, 2024

And remove most "type: none". Fixes #138

Previously I forgot to add Protocol as base class to the ModelModule. That makes ModelModule non-protocol, breaking lots of typing.

Note that inheriting from an existing protocol does not automatically turn the subclass into a protocol – it just creates a regular (non-protocol) class or ABC that implements the given protocol (or protocols). The Protocol base class must always be explicitly present if you are defining a protocol

https://mypy.readthedocs.io/en/stable/protocols.html#defining-subprotocols-and-subclassing-protocols

cc @masahi @sunggg

And remove most "type: none". Fixes octoml#138
Copy link
Member

@masahi masahi left a comment

Choose a reason for hiding this comment

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

@masahi masahi merged commit ab14322 into octoml:batch-serving Feb 8, 2024
1 check passed
Lunderberg pushed a commit to Lunderberg/mlc-llm that referenced this pull request Feb 27, 2024
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.

Protocol typing is not working
2 participants