6
6
#include <stdbool.h>
7
7
8
8
#ifdef LLAMA_SHARED
9
- # if defined( _WIN32 ) && !defined( __MINGW32__ )
9
+ # ifdef _WIN32
10
10
# ifdef LLAMA_BUILD
11
11
# define LLAMA_API __declspec(dllexport)
12
12
# else
20
20
#endif
21
21
22
22
#define LLAMA_FILE_VERSION 1
23
- #define LLAMA_FILE_MAGIC 0x67676a74 // 'ggjt ' in hex
23
+ #define LLAMA_FILE_MAGIC 0x67676d66 // 'ggmf ' in hex
24
24
#define LLAMA_FILE_MAGIC_UNVERSIONED 0x67676d6c // pre-versioned files
25
25
26
26
#ifdef __cplusplus
@@ -45,7 +45,7 @@ extern "C" {
45
45
46
46
} llama_token_data ;
47
47
48
- typedef void (* llama_progress_callback )(float progress , void * ctx );
48
+ typedef void (* llama_progress_callback )(double progress , void * ctx );
49
49
50
50
struct llama_context_params {
51
51
int n_ctx ; // text context
@@ -55,7 +55,6 @@ extern "C" {
55
55
bool f16_kv ; // use fp16 for KV cache
56
56
bool logits_all ; // the llama_eval() call computes all logits, not just the last one
57
57
bool vocab_only ; // only load the vocabulary, no weights
58
- bool use_mmap ; // use mmap if possible
59
58
bool use_mlock ; // force system to keep model in RAM
60
59
bool embedding ; // embedding mode only
61
60
@@ -67,9 +66,6 @@ extern "C" {
67
66
68
67
LLAMA_API struct llama_context_params llama_context_default_params ();
69
68
70
- LLAMA_API bool llama_mmap_supported ();
71
- LLAMA_API bool llama_mlock_supported ();
72
-
73
69
// Various functions for loading a ggml llama model.
74
70
// Allocate (almost) all memory needed for the model.
75
71
// Return NULL on failure
@@ -85,24 +81,8 @@ extern "C" {
85
81
LLAMA_API int llama_model_quantize (
86
82
const char * fname_inp ,
87
83
const char * fname_out ,
88
- int itype );
89
-
90
- // Returns the KV cache that will contain the context for the
91
- // ongoing prediction with the model.
92
- LLAMA_API const uint8_t * llama_get_kv_cache (struct llama_context * ctx );
93
-
94
- // Returns the size of the KV cache
95
- LLAMA_API size_t llama_get_kv_cache_size (struct llama_context * ctx );
96
-
97
- // Returns the number of tokens in the KV cache
98
- LLAMA_API int llama_get_kv_cache_token_count (struct llama_context * ctx );
99
-
100
- // Sets the KV cache containing the current context for the model
101
- LLAMA_API void llama_set_kv_cache (
102
- struct llama_context * ctx ,
103
- const uint8_t * kv_cache ,
104
- size_t n_size ,
105
- int n_token_count );
84
+ int itype ,
85
+ int qk );
106
86
107
87
// Run the llama inference to obtain the logits and probabilities for the next token.
108
88
// tokens + n_tokens is the provided batch of new tokens to process
@@ -155,9 +135,9 @@ extern "C" {
155
135
const llama_token * last_n_tokens_data ,
156
136
int last_n_tokens_size ,
157
137
int top_k ,
158
- float top_p ,
159
- float temp ,
160
- float repeat_penalty );
138
+ double top_p ,
139
+ double temp ,
140
+ double repeat_penalty );
161
141
162
142
// Performance information
163
143
LLAMA_API void llama_print_timings (struct llama_context * ctx );
@@ -170,4 +150,4 @@ extern "C" {
170
150
}
171
151
#endif
172
152
173
- #endif // LLAMA_H
153
+ #endif
0 commit comments