Skip to content

Commit

Permalink
add option type
Browse files Browse the repository at this point in the history
  • Loading branch information
mofosyne committed Apr 5, 2024
1 parent 34bc55f commit 3a10cec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, ClassVar, IO, Iterable, Literal, Protocol, TypeVar, runtime_checkable
from typing import TYPE_CHECKING, Any, Callable, ClassVar, IO, Iterable, Literal, Protocol, TypeVar, runtime_checkable, Optional

import numpy as np
from sentencepiece import SentencePieceProcessor
Expand Down Expand Up @@ -336,6 +336,7 @@ def load(model_plus: ModelPlus) -> Params:

return params


@dataclass
class Metadata:
name: Optional[str] = None
Expand Down Expand Up @@ -370,10 +371,12 @@ def load(metadata_path: Path) -> "Metadata":

return metadata


#
# vocab
#


@runtime_checkable
class BaseVocab(Protocol):
tokenizer_model: ClassVar[str]
Expand Down

0 comments on commit 3a10cec

Please sign in to comment.