Skip to content

Commit

Permalink
sort imports with isort
Browse files Browse the repository at this point in the history
  • Loading branch information
cebtenzzre committed Nov 7, 2023
1 parent 8047aa1 commit 4ab9105
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gguf-py/gguf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .constants import *
from .gguf_writer import *
from .gguf_reader import *
from .gguf_writer import *
from .tensor_mapping import *
from .vocab import *
6 changes: 3 additions & 3 deletions gguf-py/gguf/gguf_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
from collections import OrderedDict
from typing import TypeVar, NamedTuple
from typing import NamedTuple, TypeVar

import numpy as np
import numpy.typing as npt
Expand All @@ -15,12 +15,12 @@
sys.path.insert(0, str(Path(__file__).parent.parent))

from gguf.constants import (
GGML_QUANT_SIZES,
GGUF_DEFAULT_ALIGNMENT,
GGUF_MAGIC,
GGUF_VERSION,
GGML_QUANT_SIZES,
GGMLQuantizationType,
GGUFValueType,
GGUFValueType
)

READER_SUPPORTED_VERSIONS = [2, GGUF_VERSION]
Expand Down
7 changes: 4 additions & 3 deletions gguf-py/gguf/gguf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import shutil
import struct
import tempfile
from io import BufferedWriter
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

Expand All @@ -19,9 +19,10 @@
GGUFEndian,
GGUFValueType,
RopeScalingType,
TokenType,
TokenType
)


class WriterState(Enum):
EMPTY = auto()
HEADER = auto()
Expand Down
2 changes: 2 additions & 0 deletions gguf-py/gguf/tensor_mapping.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations

from typing import Sequence

from .constants import MODEL_ARCH, MODEL_TENSOR, MODEL_TENSORS, TENSOR_NAMES


class TensorNameMap:
mappings_cfg: dict[MODEL_TENSOR, tuple[str, ...]] = {
# Token embeddings
Expand Down
1 change: 1 addition & 0 deletions gguf-py/gguf/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .gguf_writer import GGUFWriter


class SpecialVocab:
merges: list[str]
special_token_ids: dict[str, int]
Expand Down

0 comments on commit 4ab9105

Please sign in to comment.