Krotos Modules 3
Loading...
Searching...
No Matches
bert.h File Reference

Go to the source code of this file.

Classes

struct  bert_params
 

Typedefs

typedef int32_t bert_vocab_id
 

Functions

bool bert_params_parse (int argc, char **argv, bert_params &params)
 
struct bert_ctx * bert_load_from_file (const char *fname)
 
void bert_free (bert_ctx *ctx)
 
void bert_encode (struct bert_ctx *ctx, int32_t n_threads, const char *texts, float *embeddings)
 
void bert_encode_batch (struct bert_ctx *ctx, int32_t n_threads, int32_t n_batch_size, int32_t n_inputs, const char **texts, float **embeddings)
 
void bert_tokenize (struct bert_ctx *ctx, const char *text, bert_vocab_id *tokens, int32_t *n_tokens, int32_t n_max_tokens)
 
void bert_eval (struct bert_ctx *ctx, int32_t n_threads, bert_vocab_id *tokens, int32_t n_tokens, float *embeddings)
 
void bert_eval_batch (struct bert_ctx *ctx, int32_t n_threads, int32_t n_batch_size, bert_vocab_id **batch_tokens, int32_t *n_tokens, float **batch_embeddings)
 
int32_t bert_n_embd (bert_ctx *ctx)
 
int32_t bert_n_max_tokens (bert_ctx *ctx)
 
const char * bert_vocab_id_to_token (bert_ctx *ctx, bert_vocab_id id)
 

Typedef Documentation

◆ bert_vocab_id

typedef int32_t bert_vocab_id

Function Documentation

◆ bert_encode()

void bert_encode ( struct bert_ctx * ctx,
int32_t n_threads,
const char * texts,
float * embeddings )

◆ bert_encode_batch()

void bert_encode_batch ( struct bert_ctx * ctx,
int32_t n_threads,
int32_t n_batch_size,
int32_t n_inputs,
const char ** texts,
float ** embeddings )

◆ bert_eval()

void bert_eval ( struct bert_ctx * ctx,
int32_t n_threads,
bert_vocab_id * tokens,
int32_t n_tokens,
float * embeddings )

◆ bert_eval_batch()

void bert_eval_batch ( struct bert_ctx * ctx,
int32_t n_threads,
int32_t n_batch_size,
bert_vocab_id ** batch_tokens,
int32_t * n_tokens,
float ** batch_embeddings )

◆ bert_free()

void bert_free ( bert_ctx * ctx)

◆ bert_load_from_file()

struct bert_ctx * bert_load_from_file ( const char * fname)

◆ bert_n_embd()

int32_t bert_n_embd ( bert_ctx * ctx)

◆ bert_n_max_tokens()

int32_t bert_n_max_tokens ( bert_ctx * ctx)

◆ bert_params_parse()

bool bert_params_parse ( int argc,
char ** argv,
bert_params & params )

◆ bert_tokenize()

void bert_tokenize ( struct bert_ctx * ctx,
const char * text,
bert_vocab_id * tokens,
int32_t * n_tokens,
int32_t n_max_tokens )

◆ bert_vocab_id_to_token()

const char * bert_vocab_id_to_token ( bert_ctx * ctx,
bert_vocab_id id )