New type annotation for serialize
This commit is contained in:
parent
7e7b5f3e9c
commit
9916744801
|
@ -3,7 +3,7 @@
|
||||||
import gptc.tokenizer
|
import gptc.tokenizer
|
||||||
from gptc.exceptions import InvalidModelError
|
from gptc.exceptions import InvalidModelError
|
||||||
import gptc.weighting
|
import gptc.weighting
|
||||||
from typing import Iterable, Mapping, List, Dict, Union, cast
|
from typing import Iterable, Mapping, List, Dict, Union, cast, BinaryIO
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class Model:
|
||||||
for index, category in enumerate(self.names)
|
for index, category in enumerate(self.names)
|
||||||
}
|
}
|
||||||
|
|
||||||
def serialize(self, file):
|
def serialize(self, file: BinaryIO):
|
||||||
file.write(b"GPTC model v4\n")
|
file.write(b"GPTC model v4\n")
|
||||||
file.write(
|
file.write(
|
||||||
json.dumps(
|
json.dumps(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user