Golang bindings initial working version(#534)

* WIP

* Fix includes

* Try to fix linking issues

* Refinements

* allow to load MPT and llama models too

* cleanup, add example, add README
This commit is contained in:
Ettore Di Giacinto
2023-05-15 18:45:56 +02:00
committed by GitHub
parent 2433902460
commit 3f63cc6b47
11 changed files with 801 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
void* load_mpt_model(const char *fname, int n_threads);
void* load_llama_model(const char *fname, int n_threads);
void* load_gptj_model(const char *fname, int n_threads);
void gptj_model_prompt( const char *prompt, void *m, char* result, int repeat_last_n, float repeat_penalty, int n_ctx, int tokens, int top_k,
float top_p, float temp, int n_batch,float ctx_erase);
void gptj_free_model(void *state_ptr);
extern unsigned char getTokenCallback(void *, char *);
#ifdef __cplusplus
}
#endif