embd-input.h 639 B

123456789101112131415161718192021222324252627
  1. #ifndef _EMBD_INPUT_H_
  2. #define _EMBD_INPUT_H_ 1
  3. #include "common.h"
  4. #include "llama.h"
  5. extern "C" {
  6. typedef struct MyModel {
  7. llama_context* ctx;
  8. gpt_params params;
  9. int n_past = 0;
  10. } MyModel;
  11. struct MyModel* create_mymodel(int argc, char ** argv);
  12. bool eval_float(void* model, float* input, int N);
  13. bool eval_tokens(void* model, std::vector<llama_token> tokens);
  14. bool eval_id(struct MyModel* mymodel, int id);
  15. bool eval_string(struct MyModel* mymodel, const char* str);
  16. const char * sampling(struct MyModel* mymodel);
  17. llama_token sampling_id(struct MyModel* mymodel);
  18. void free_mymodel(struct MyModel* mymodel);
  19. }
  20. #endif