aboutsummaryrefslogtreecommitdiff
path: root/libffwd/sentencepiece.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-09-29 13:05:44 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-09-29 13:05:44 +0200
commitcf7d8169ec12cb3adf90d4ff78b3257e74985302 (patch)
treef666589acfd68e76bbde4e74eead44ae7819d0bb /libffwd/sentencepiece.h
parent91871be6ece9317c5d49353f6474583e7e28168d (diff)
downloadlangdet-cf7d8169ec12cb3adf90d4ff78b3257e74985302.tar.gz
langdet-cf7d8169ec12cb3adf90d4ff78b3257e74985302.zip
Remove unused model families and inference paths
Diffstat (limited to 'libffwd/sentencepiece.h')
-rw-r--r--libffwd/sentencepiece.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/libffwd/sentencepiece.h b/libffwd/sentencepiece.h
index b79f47c..2230538 100644
--- a/libffwd/sentencepiece.h
+++ b/libffwd/sentencepiece.h
@@ -52,32 +52,15 @@ typedef struct tok_spm_workspace tok_spm_workspace_t;
* on missing model file, unsupported model type, malformed protobuf, or OOM. */
tok_spm_t *tok_spm_load(const char *model_dir);
-/* Decode one model-space id to an internal token string, or NULL when invalid. */
-const char *tok_spm_decode(const tok_spm_t *tok, int id);
-
/* Resolve a named token (e.g. "<s>", "</s>", "<pad>", "<mask>") to a
* model-space id, or -1 when absent. */
int tok_spm_token_id(const tok_spm_t *tok, const char *token);
-/* Encode UTF-8 text into malloc'd model-space token ids. Empty text returns
- * NULL with *out_n_tokens = 0. NULL with a negative/unspecified count is an
- * error. */
-int *tok_spm_encode(const tok_spm_t *tok, const char *text, int *out_n_tokens);
-
tok_spm_workspace_t *tok_spm_workspace_new(void);
void tok_spm_workspace_free(tok_spm_workspace_t *ws);
-/* Encode into caller-provided out_ids. Returns 0 on success, -1 on error, -2 if
- * out_cap is too small. *out_n_tokens receives the emitted/needed token count. */
-int tok_spm_encode_into(const tok_spm_t *tok,
- tok_spm_workspace_t *ws,
- const char *text,
- int *out_ids,
- int out_cap,
- int *out_n_tokens);
-
-/* Same tokenization as tok_spm_encode(), reusing ws internally
- * and performing only the final returned int[] allocation. */
+/* Return malloc-owned model-space token IDs, reusing workspace scratch.
+ * Empty text returns NULL with a zero count. */
int *tok_spm_encode_with_workspace(const tok_spm_t *tok,
tok_spm_workspace_t *ws,
const char *text,