From 37cbaef9ceb828c667da8f398027ba5415ee7475 Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Tue, 29 Sep 2026 13:11:00 +0200 Subject: Rename CPU library API and sources to langdet --- libffwd/ffwd.h | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 libffwd/ffwd.h (limited to 'libffwd/ffwd.h') diff --git a/libffwd/ffwd.h b/libffwd/ffwd.h deleted file mode 100644 index 527e92f..0000000 --- a/libffwd/ffwd.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef FFWD_H -#define FFWD_H - -#include - -#define FFWD_MAX_LAYERS 64 - -typedef struct { - int hidden_size; - int n_layers; - int n_heads; - int head_dim; - int intermediate_size; - int vocab_size; - int max_position_embeddings; - int position_id_offset; /* XLM-R positions start at pad_token_id + 1. */ - int type_vocab_size; - float layer_norm_eps; -} ffwd_config_t; - -typedef struct ffwd_model ffwd_model_t; -typedef struct ffwd_workspace ffwd_workspace_t; -typedef struct ffwd_tok ffwd_tok_t; - -/* The model owns its memory-mapped F32 weights. Workspaces must be freed first. */ -ffwd_model_t *ffwd_model_load(const char *model_dir); -void ffwd_model_free(ffwd_model_t *model); -const ffwd_config_t *ffwd_model_config(const ffwd_model_t *model); - -/* A workspace belongs to one model and may serve only one inference call at a time. */ -ffwd_workspace_t *ffwd_workspace_new(const ffwd_model_t *model); -void ffwd_workspace_free(ffwd_workspace_t *ws); - -/* Write the first token's final hidden state to out_embedding[hidden_size]. - * Token IDs must include and , without padding. Returns 0 or -1 on error. */ -int ffwd_model_encode_into(const ffwd_model_t *model, - ffwd_workspace_t *ws, - const int *token_ids, - int n_tokens, - float *out_embedding); - -ffwd_tok_t *ffwd_tok_open(const char *model_dir, char *err, size_t errlen); -void ffwd_tok_free(ffwd_tok_t *t); - -/* Return malloc-owned IDs wrapped with and , or NULL on error. - * The tokenizer owns reusable scratch and is not safe for concurrent calls. */ -int *ffwd_tokenize(ffwd_tok_t *t, const char *text, int *n_out); - -#endif /* FFWD_H */ -- cgit v1.3.1