Revert "restore 3.9 compatibility by replacing | with Union[]"

This reverts commit 76bafeb99e.
This commit is contained in:
Lincoln Stein
2023-07-03 10:56:41 -04:00
parent 73a27918c6
commit 2465c7987b
16 changed files with 37 additions and 43 deletions

View File

@ -4,7 +4,6 @@ from contextlib import nullcontext
import torch
from torch import autocast
from typing import Union
from invokeai.app.services.config import InvokeAIAppConfig
CPU_DEVICE = torch.device("cpu")
@ -50,7 +49,7 @@ def choose_autocast(precision):
return nullcontext
def normalize_device(device: Union[str, torch.device]) -> torch.device:
def normalize_device(device: str | torch.device) -> torch.device:
"""Ensure device has a device index defined, if appropriate."""
device = torch.device(device)
if device.index is None: