Lightning-AI / LitServe

Lightning-fast serving engine for any AI model of any size. Flexible. Easy. Enterprise-scale.
https://lightning.ai/docs/litserve
Apache License 2.0
2.5k stars 158 forks source link

Pyright issues [Name mismatches] #310

Closed grumpyp closed 1 month ago

grumpyp commented 1 month ago

šŸ› Bug Report

Description

When creating a new notebook via Lightning and copying the example code from the README, Pyright shows issues with the abstract methods of the LitAPI base class.

The error occurs due to a parameter name mismatch in method overrides:

Method "setup" overrides class "LitAPI" in an incompatible manner Parameter 2 name mismatch: base parameter is named "devices", override parameter is named "device" Pyright[reportIncompatibleMethodOverride]

image

Steps to Reproduce

  1. Open a new notebook in Lightning Studio.
  2. Copy the example code from the README.
  3. Observe the Pyright issues that appear for the LitAPI base class methods.

Expected Behavior

No Pyright issues should be present. Although this won't block users, it can cause confusion, especially for those new to the framework.

Environment

Additional Context

Iā€™d be happy to work on resolving this issue (Updating the README should do the job?)

aniketmaurya commented 1 month ago

thanks for identifying the issue @grumpyp. If you are interested in contributing to this as well - you can rename the devices argument here to device.

Borda commented 1 month ago

cc: @ethanwharris šŸ¦©