From ad8cf2e6d54b92a274dcfa4af970c85f789ae789 Mon Sep 17 00:00:00 2001 From: Shaw Date: Tue, 13 Oct 2026 21:39:16 -0700 Subject: [PATCH] tools/paradee: pass the ty type-check and editorconfig (#69) - HPARAMS in the converter holds ints, floats and lists; annotate it as dict[str, Any] so ty does not infer a union for every lookup. - The reference dumper imports kokoro, misaki and espeakng_loader, which CI does not install; give tools/paradee/tools the same ty override as tools/kokoro/tools. - Final newline in kokoro-decoder-front.h (missing before this PR too). Co-authored-by: Claude Opus 5.5 --- tools/kokoro/include/kokoro-decoder-front.h | 2 +- tools/paradee/convert_paradee_pt_to_gguf.py | 3 ++- ty.toml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/kokoro/include/kokoro-decoder-front.h b/tools/kokoro/include/kokoro-decoder-front.h index 11244bba8..b3bb5e3a0 100644 --- a/tools/kokoro/include/kokoro-decoder-front.h +++ b/tools/kokoro/include/kokoro-decoder-front.h @@ -153,4 +153,4 @@ inline void decoder_front( x_out.swap(x); // [decode[3].Cout, 2*T_asr] } -} // namespace eliza_kokoro \ No newline at end of file +} // namespace eliza_kokoro diff --git a/tools/paradee/convert_paradee_pt_to_gguf.py b/tools/paradee/convert_paradee_pt_to_gguf.py index 08ed16500..b8396ffc3 100644 --- a/tools/paradee/convert_paradee_pt_to_gguf.py +++ b/tools/paradee/convert_paradee_pt_to_gguf.py @@ -42,6 +42,7 @@ import os import sys from pathlib import Path +from typing import Any import numpy as np @@ -57,7 +58,7 @@ # Architecture of Paradee-8M v1.0, read from the checkpoint shapes and from # training/scripts/{student.py, student_decoder.py} at the pinned source # commit. The converter checks every tensor against these values. -HPARAMS = { +HPARAMS: dict[str, Any] = { # CustomAlbert (transformers AlbertConfig, num_hidden_groups=1). "text.n_layer": 6, "text.n_head": 4, diff --git a/ty.toml b/ty.toml index 06cf2d8c5..dbc0520e4 100644 --- a/ty.toml +++ b/ty.toml @@ -24,6 +24,9 @@ include = [ # only in that pinned env (see tools/misaki-g2p/README.md), not under CI. "./tools/misaki-g2p/scripts/**", "./tools/misaki-g2p/tests/**", + # Same for the Paradee reference dumper (kokoro, misaki, espeakng_loader + # and the paradee training scripts are pinned in its own environment). + "./tools/paradee/tools/**", # conversion/* defines mixins (e.g. _Qwen35MtpMixin) whose super() # chains resolve to attributes provided by the composed Model # subclasses in convert_hf_to_gguf.py. ty cannot see that