embd-input.h 663 B

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