mirror of
https://github.com/amazon-science/chronos-forecasting
synced 2026-05-24 01:58:27 +00:00
Use typing_extensions for NotRequired
This commit is contained in:
parent
7695bf1442
commit
47be457206
2 changed files with 7 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ dependencies = [
|
|||
"numpy>=1.21,<3",
|
||||
"einops>=0.7.0,<1",
|
||||
"scikit-learn>=1.6.0,<2",
|
||||
"typing_extensions~=4.0",
|
||||
]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import math
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Any, Iterable, Iterator, Mapping, NotRequired, Sequence, TypeAlias, TypedDict, cast
|
||||
from typing import TYPE_CHECKING, Any, Iterable, Iterator, Mapping, Sequence, TypeAlias, TypedDict, cast
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
|
@ -16,6 +16,11 @@ if TYPE_CHECKING:
|
|||
import datasets
|
||||
import fev
|
||||
|
||||
try:
|
||||
from typing import NotRequired # Python 3.11+
|
||||
except ImportError:
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
|
||||
TensorOrArray: TypeAlias = torch.Tensor | np.ndarray
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue