Pin the versions of the files we're using and allow offline use (#27)

Without a specific commit, huggingface cannot be sure that the file has
not changed, so it needs to do a quick query to hf hub to check that
there were no new commits. This adds some latency to the CLI and
function calls, but it also prevents offline use, even if the files are
already present locally. This PRs fixes this. Now with the commit hash,
hf has the guarantee that the local files are the right ones and thus
doesn't need to query the hub every time.

Fix https://github.com/kyutai-labs/pocket-tts/pull/21
This commit is contained in:
Gabriel de Marmiesse
2026-01-14 12:55:38 +01:00
committed by GitHub
parent 4381db0fab
commit 46bb28f448
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ PROJECT_ROOT = Path(__file__).parent.parent.parent
_voices_names = ["alba", "marius", "javert", "jean", "fantine", "cosette", "eponine", "azelma"]
PREDEFINED_VOICES = {
# don't forget to change this
x: f"hf://kyutai/pocket-tts-without-voice-cloning/embeddings/{x}.safetensors"
x: f"hf://kyutai/pocket-tts-without-voice-cloning/embeddings/{x}.safetensors@d4fdd22ae8c8e1cb3634e150ebeff1dab2d16df3"
for x in _voices_names
}