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

Preserve Python 3.9 compatibility #10578

Merged
merged 2 commits into from May 20, 2023
Merged

Conversation

anonCantCode
Copy link
Contributor

Describe what this pull request is trying to achieve.

The dev branch currently does not launch due to a TypeError in Python 3.9 environments (e.g. Colab Pro, Paperspace Gradient). This is because of newer Optional type syntax usage in shared.py added by #10458. This PR changes three lines to use typing.Optional instead to preserve backwards compatibility.

Additional notes and description of your changes

It's a minor syntax change and I've tested launch and restarts to be working but please ensure everything is correct as I'm not really a programmer. Thank you.

Environment this was tested in

  • OS: Linux (Paperspace Gradient)
  • Browser: Firefox
  • Graphics card: Nvidia RTX A4000

@Sakura-Luna
Copy link
Collaborator

As far as I know Colab has been upgraded to 3.10 by default.
https://medium.com/google-colab/colab-updated-to-python-3-10-27eb02daa162

@anonCantCode
Copy link
Contributor Author

Oh, I was unaware of the update. Regardless, Paperspace Gradient is still on 3.9, which is where I was testing and what a lot of people now use after Colab restricted WebUI usage for the free tier.

@AUTOMATIC1111
Copy link
Owner

wish out linter told us about that

@AUTOMATIC1111 AUTOMATIC1111 merged commit db1ce5a into AUTOMATIC1111:dev May 20, 2023
@akx
Copy link
Collaborator

akx commented May 20, 2023

@AUTOMATIC1111 The alternative fix is to add from __future__ import annotations (so annotations aren't evaluated at runtime)

@anonCantCode
Copy link
Contributor Author

Merging the ui-selection-for-cross-attention-optimization branch added a couple more instances of the newer syntax, again rendering it unable to launch on Paperspace. I'll refrain from making another PR since I assume the fix @akx is proposing is better?

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.

None yet

4 participants