mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-21 11:29:48 +00:00
python: use TypedDict from typing_extensions on python 3.9 and 3.10
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
committed by
Aaron Miller
parent
adea3811ea
commit
446668674e
@@ -9,13 +9,19 @@ import sys
|
||||
import threading
|
||||
from enum import Enum
|
||||
from queue import Queue
|
||||
from typing import Any, Callable, Generic, Iterable, TypedDict, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Iterable, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
import importlib.resources as importlib_resources
|
||||
else:
|
||||
import importlib_resources
|
||||
|
||||
if (3, 9) <= sys.version_info < (3, 11):
|
||||
# python 3.9 broke generic TypedDict, python 3.11 fixed it
|
||||
from typing_extensions import TypedDict
|
||||
else:
|
||||
from typing import TypedDict
|
||||
|
||||
EmbeddingsType = TypeVar('EmbeddingsType', bound='list[Any]')
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user