21#ifndef __GGMA_GGMA_TOKENIZE_H__
22#define __GGMA_GGMA_TOKENIZE_H__
80 int32_t *tokens,
size_t n_tokens_max,
size_t *n_tokens);
98 char *text,
size_t text_len);
struct ggma_tokenizer ggma_tokenizer
Opaque handle to a GGMA tokenizer.
GGMA_STATUS ggma_create_tokenizer(ggma_tokenizer **tokenizer, const char *tokenizer_path)
Creates a GGMA tokenizer from a specified tokenizer path.
GGMA_STATUS ggma_free_tokenizer(ggma_tokenizer *tokenizer)
Frees all resources associated with a GGMA tokenizer.
GGMA_STATUS ggma_detokenize(const ggma_tokenizer *tokenizer, const int32_t *tokens, size_t n_tokens, char *text, size_t text_len)
Detokenizes a sequence of token IDs back into a text string.
GGMA_STATUS ggma_tokenize(const ggma_tokenizer *tokenizer, const char *text, size_t text_len, int32_t *tokens, size_t n_tokens_max, size_t *n_tokens)
Tokenizes an input text string into a sequence of token IDs.
This file defines the core types and status codes for GGMA API.
GGMA_STATUS
Enumeration of status codes returned by GGMA API functions.