-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Community effort] Type Hints #287
Comments
Lots of beginner good first issues here for a first contribution. The way it works is easy! Pick some numbers by posting them here as a message here, open a PR to add type hints, ping @anton-l @patil-suraj @pcuenca or @patrickvonplaten on the PR to merge it and we'll tick your numbers of :-) Example: I'm taking numbers 39. and 40. and will attach a PR below Note: Don't forget to run |
Maybe that would also be a good idea to make a GitHub action to check that |
Usually we're happy with just |
Well it catches typing errors... That would be a good idea when you add type hints. |
What do you think here @anton-l @patil-suraj @pcuenca - note that we don't have it in Transformers and might require some more setting up . Not sure if it's worth it from my point of view, but happy to go for it if others think it's a good idea. Also cc @LysandreJik @sgugger would love to hear your opinion on mypy |
I do have some opinions on mypy ;-) It usually ends up requiring the maintainer to write some horrible type hints that no one reading it will understand. IMO you should focus on having type hints which make your code better documented and are readable and understandable, but enabling |
Hey, if there is no problem. I'm taking numbers 37. and 38. and will attach a PR below. |
I'll be taking numbers 35. and 36. and will attach a PR below. |
Hi! I'll take numbers 1 and 2, attaching a PR below. |
I'll be taking 33 and 34. Will attach a PR below. |
I'll work on numbers 24, 25, and 26. and will attach a PR below. |
I'll take 12, 13 and 14 and will attach a PR below |
I'll work on 3, 4, 7, 10, and 11 and will attach a PR below |
I'll pick up 30, 31 and 32, attaching a PR below |
Hello, I will be taking 5, 6. Will attach a PR. |
I'll work on 15, 16, and 17 and will attach a PR below. |
I'll take 18, 19 and 20 and will attach a PR below |
I'll take 21, 22 and 23 and will attach a PR below |
I'll take 27, 28 and 29 and will attach a PR |
I'll take on 8 and will attach a PR |
Amazing work everyone here - we can close this issue 🥳 Our IDEs should be happy now |
currently setup for tf bert/resnet50 going to refactor test class to avoid having to add an argument to 50+ files
Is your feature request related to a problem? Please describe.
Many important functions and classes are missing type hints
Describe the solution you'd like
It would be great if the following functions could have better type hints to understand what input is expected.
Models
diffusers/src/diffusers/models/unet_2d.py
Line 14 in 7e1b202
diffusers/src/diffusers/models/unet_2d_condition.py
Line 14 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 394 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 443 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 432 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 438 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 328 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 370 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 375 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 385 in 7e1b202
diffusers/src/diffusers/models/vae.py
Line 296 in 7e1b202
Schedulers
diffusers/src/diffusers/schedulers/scheduling_ddim.py
Line 53 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_ddim.py
Line 103 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_ddim.py
Line 179 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_ddpm.py
Line 52 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_ddpm.py
Line 90 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_ddpm.py
Line 182 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_karras_ve.py
Line 36 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_karras_ve.py
Line 71 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_karras_ve.py
Line 82 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_lms_discrete.py
Line 28 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_lms_discrete.py
Line 82 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_lms_discrete.py
Line 126 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_pndm.py
Line 52 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_pndm.py
Line 100 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_pndm.py
Line 263 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_sde_ve.py
Line 40 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_sde_ve.py
Line 62 in 7e1b202
diffusers/src/diffusers/schedulers/scheduling_sde_ve.py
Line 72 in 7e1b202
Pipelines
diffusers/src/diffusers/pipelines/ddim/pipeline_ddim.py
Line 31 in 7e1b202
diffusers/src/diffusers/pipelines/ddpm/pipeline_ddpm.py
Line 31 in 7e1b202
diffusers/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py
Line 19 in 7e1b202
diffusers/src/diffusers/pipelines/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py
Line 10 in 7e1b202
diffusers/src/diffusers/pipelines/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py
Line 16 in 7e1b202
diffusers/src/diffusers/pipelines/pndm/pipeline_pndm.py
Line 31 in 7e1b202
diffusers/src/diffusers/pipelines/pndm/pipeline_pndm.py
Line 25 in 7e1b202
diffusers/src/diffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py
Line 10 in 7e1b202
diffusers/src/diffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py
Line 15 in 7e1b202
diffusers/src/diffusers/pipelines/stochatic_karras_ve/pipeline_stochastic_karras_ve.py
Line 24 in 7e1b202
diffusers/src/diffusers/pipelines/stochatic_karras_ve/pipeline_stochastic_karras_ve.py
Line 30 in 7e1b202
The text was updated successfully, but these errors were encountered: