-
Notifications
You must be signed in to change notification settings - Fork 102
Remove upstream partial transformers stubs #381
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
Remove upstream partial transformers stubs #381
Conversation
…into Remove-upstream-partial-transformers-stubs
Hey 👋 I'm a user of Pylance and would like to +1 the request for putting in the I am currently hitting this old issue (microsoft/pylance-release#1258) which was resolved by adding type stubs in this package. I'm guessing that they've been removed from this repo and added to Transformers but a new version of Transformers with the stubs hasn't been published yet (meaning there's probably a small limbo period where that old issue will occur), so it might be good to mention just in case anyone else runs into this in the next few days. |
I could've kept this as draft until next transformers release since some type information is lost atm. Right now as a quick fix you could install these stubs on the commit right before the partial transformers stubs were removed: That would also cause pyright and mypy to find the stubs. Not just Pylance. Looking at microsoft/pylance-release#1258 (comment) , I could not replicate those numbers, at most I got ~800ms (Unless I just restarted the language server, but then, partial stubs or not, the initial run does take a lot more time, indeed 4-6s, because with |
Interesting, perhaps my issue is something else then? I also saw the initial ~3000ms at server reload, and then it looks like the language server is getting killed because of a timeout:
I assumed that was the causing issues, because completions often hang for a while and syntax highlighting is sluggish (adding/changing a line sometimes takes upwards of ~2s to rehighlight), but maybe not? I'll try these stubs from the old commit and see if that works. UPDATE: I think that works! I'm still seeing a tiny bit of lag for syntax highlighting, but more like ~1/2s instead of the ~2s from before! |
@isaac-mcfadyen, for what it's worth, we haven't shipped a release of Pylance with this change yet. |
Oh that's definitely odd, my issue must be unrelated then... Sorry for hijacking this PR 😄 |
Upstreamed at huggingface/transformers#38335
I'm not entirely certain if it's worth mentioning in the
Upstreamed libraries
section given how tiny the stub was. Up to you.