Add type annotation to Model.get()

This commit is contained in:
Samuel Sloniker 2022-11-27 13:36:49 -08:00
parent e4eb322aa7
commit 8d42a92848
Signed by: kj7rrv
GPG Key ID: 1BB4029E66285A62

View File

@ -62,7 +62,7 @@ class Model:
}
return probs
def get(self, token):
def get(self, token: str) -> Dict[str, float]:
try:
weights = self.weights[
gptc.tokenizer.hash_single(gptc.tokenizer.normalize(token))