mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
change typehint "a|b" operation to Union[a,b] to run on Python < 3.10
- this incompatibility was introduced by #1525 and missed during code review
This commit is contained in:
parent
37bcf9cc47
commit
40a7f47d22
@ -17,6 +17,7 @@ import transformers
|
||||
import traceback
|
||||
import textwrap
|
||||
import contextlib
|
||||
from typing import Union
|
||||
from omegaconf import OmegaConf
|
||||
from omegaconf.errors import ConfigAttributeError
|
||||
from ldm.util import instantiate_from_config, ask_user
|
||||
@ -388,7 +389,7 @@ class ModelCache(object):
|
||||
def _has_cuda(self) -> bool:
|
||||
return self.device.type == 'cuda'
|
||||
|
||||
def _cached_sha256(self,path,data) -> str | bytes:
|
||||
def _cached_sha256(self,path,data) -> Union[str, bytes]:
|
||||
dirname = os.path.dirname(path)
|
||||
basename = os.path.basename(path)
|
||||
base, _ = os.path.splitext(basename)
|
||||
|
Loading…
Reference in New Issue
Block a user