sort imports with isort (again)

This commit is contained in:
Jared Van Bortel 2023-11-07 20:28:35 -05:00
parent d7688dc937
commit a6f5742a53
6 changed files with 12 additions and 8 deletions

View file

@ -1,5 +1,5 @@
from .constants import * from .constants import *
from .gguf_writer import *
from .gguf_reader import * from .gguf_reader import *
from .gguf_writer import *
from .tensor_mapping import * from .tensor_mapping import *
from .vocab import * from .vocab import *

View file

@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
import sys import sys
from enum import Enum, IntEnum, auto, StrEnum from enum import Enum, IntEnum, StrEnum, auto
from typing import Any, NamedTuple, Type from typing import Any, NamedTuple, Type
# #

View file

@ -2,7 +2,7 @@ from __future__ import annotations
import os import os
from collections import OrderedDict from collections import OrderedDict
from typing import Any, TypeVar, NamedTuple, Dict, Type, Literal from typing import Any, Dict, Literal, NamedTuple, Type, TypeVar
import numpy as np import numpy as np
import numpy.typing as npt import numpy.typing as npt
@ -15,12 +15,12 @@ if __name__ == "__main__":
sys.path.insert(0, str(Path(__file__).parent.parent)) sys.path.insert(0, str(Path(__file__).parent.parent))
from gguf.constants import ( from gguf.constants import (
GGML_QUANT_SIZES,
GGUF_DEFAULT_ALIGNMENT, GGUF_DEFAULT_ALIGNMENT,
GGUF_MAGIC, GGUF_MAGIC,
GGUF_VERSION, GGUF_VERSION,
GGML_QUANT_SIZES,
GGMLQuantizationType, GGMLQuantizationType,
GGUFValueType, GGUFValueType
) )
READER_SUPPORTED_VERSIONS = [2, GGUF_VERSION] READER_SUPPORTED_VERSIONS = [2, GGUF_VERSION]

View file

@ -4,9 +4,9 @@ import os
import shutil import shutil
import struct import struct
import tempfile import tempfile
from io import BufferedWriter
from enum import Enum, auto from enum import Enum, auto
from typing import Any, IO, Sequence from io import BufferedWriter
from typing import IO, Any, Sequence
import numpy as np import numpy as np
@ -19,9 +19,10 @@ from .constants import (
GGUFEndian, GGUFEndian,
GGUFValueType, GGUFValueType,
RopeScalingType, RopeScalingType,
TokenType, TokenType
) )
class WriterState(Enum): class WriterState(Enum):
EMPTY = auto() EMPTY = auto()
HEADER = auto() HEADER = auto()

View file

@ -1,8 +1,10 @@
from __future__ import annotations from __future__ import annotations
from typing import Sequence from typing import Sequence
from .constants import MODEL_ARCH, MODEL_TENSOR, MODEL_TENSORS, TENSOR_NAMES from .constants import MODEL_ARCH, MODEL_TENSOR, MODEL_TENSORS, TENSOR_NAMES
class TensorNameMap: class TensorNameMap:
mappings_cfg: dict[MODEL_TENSOR, tuple[str, ...]] = { mappings_cfg: dict[MODEL_TENSOR, tuple[str, ...]] = {
# Token embeddings # Token embeddings

View file

@ -8,6 +8,7 @@ from typing import Any, Callable
from .gguf_writer import GGUFWriter from .gguf_writer import GGUFWriter
class SpecialVocab: class SpecialVocab:
merges: list[str] merges: list[str]
special_token_ids: dict[str, int] special_token_ids: dict[str, int]