@@ -206,7 +206,7 @@ def llama_free(ctx: llama_context_p):
206
206
# nthread - how many threads to use. If <=0, will use std::thread::hardware_concurrency(), else the number given
207
207
def llama_model_quantize (
208
208
fname_inp : bytes , fname_out : bytes , ftype : c_int , nthread : c_int
209
- ) -> c_int :
209
+ ) -> int :
210
210
return _lib .llama_model_quantize (fname_inp , fname_out , ftype , nthread )
211
211
212
212
@@ -225,7 +225,7 @@ def llama_apply_lora_from_file(
225
225
path_lora : c_char_p ,
226
226
path_base_model : c_char_p ,
227
227
n_threads : c_int ,
228
- ) -> c_int :
228
+ ) -> int :
229
229
return _lib .llama_apply_lora_from_file (ctx , path_lora , path_base_model , n_threads )
230
230
231
231
@@ -234,7 +234,7 @@ def llama_apply_lora_from_file(
234
234
235
235
236
236
# Returns the number of tokens in the KV cache
237
- def llama_get_kv_cache_token_count (ctx : llama_context_p ) -> c_int :
237
+ def llama_get_kv_cache_token_count (ctx : llama_context_p ) -> int :
238
238
return _lib .llama_get_kv_cache_token_count (ctx )
239
239
240
240
@@ -253,7 +253,7 @@ def llama_set_rng_seed(ctx: llama_context_p, seed: c_int):
253
253
254
254
# Returns the maximum size in bytes of the state (rng, logits, embedding
255
255
# and kv_cache) - will often be smaller after compacting tokens
256
- def llama_get_state_size (ctx : llama_context_p ) -> c_size_t :
256
+ def llama_get_state_size (ctx : llama_context_p ) -> int :
257
257
return _lib .llama_get_state_size (ctx )
258
258
259
259
@@ -293,7 +293,7 @@ def llama_load_session_file(
293
293
tokens_out , # type: Array[llama_token]
294
294
n_token_capacity : c_size_t ,
295
295
n_token_count_out , # type: _Pointer[c_size_t]
296
- ) -> c_size_t :
296
+ ) -> int :
297
297
return _lib .llama_load_session_file (
298
298
ctx , path_session , tokens_out , n_token_capacity , n_token_count_out
299
299
)
@@ -314,7 +314,7 @@ def llama_save_session_file(
314
314
path_session : bytes ,
315
315
tokens , # type: Array[llama_token]
316
316
n_token_count : c_size_t ,
317
- ) -> c_size_t :
317
+ ) -> int :
318
318
return _lib .llama_save_session_file (ctx , path_session , tokens , n_token_count )
319
319
320
320
@@ -337,7 +337,7 @@ def llama_eval(
337
337
n_tokens : c_int ,
338
338
n_past : c_int ,
339
339
n_threads : c_int ,
340
- ) -> c_int :
340
+ ) -> int :
341
341
return _lib .llama_eval (ctx , tokens , n_tokens , n_past , n_threads )
342
342
343
343
@@ -364,23 +364,23 @@ def llama_tokenize(
364
364
_lib .llama_tokenize .restype = c_int
365
365
366
366
367
- def llama_n_vocab (ctx : llama_context_p ) -> c_int :
367
+ def llama_n_vocab (ctx : llama_context_p ) -> int :
368
368
return _lib .llama_n_vocab (ctx )
369
369
370
370
371
371
_lib .llama_n_vocab .argtypes = [llama_context_p ]
372
372
_lib .llama_n_vocab .restype = c_int
373
373
374
374
375
- def llama_n_ctx (ctx : llama_context_p ) -> c_int :
375
+ def llama_n_ctx (ctx : llama_context_p ) -> int :
376
376
return _lib .llama_n_ctx (ctx )
377
377
378
378
379
379
_lib .llama_n_ctx .argtypes = [llama_context_p ]
380
380
_lib .llama_n_ctx .restype = c_int
381
381
382
382
383
- def llama_n_embd (ctx : llama_context_p ) -> c_int :
383
+ def llama_n_embd (ctx : llama_context_p ) -> int :
384
384
return _lib .llama_n_embd (ctx )
385
385
386
386
@@ -426,23 +426,23 @@ def llama_token_to_str(ctx: llama_context_p, token: llama_token) -> bytes:
426
426
# Special tokens
427
427
428
428
429
- def llama_token_bos () -> llama_token :
429
+ def llama_token_bos () -> int :
430
430
return _lib .llama_token_bos ()
431
431
432
432
433
433
_lib .llama_token_bos .argtypes = []
434
434
_lib .llama_token_bos .restype = llama_token
435
435
436
436
437
- def llama_token_eos () -> llama_token :
437
+ def llama_token_eos () -> int :
438
438
return _lib .llama_token_eos ()
439
439
440
440
441
441
_lib .llama_token_eos .argtypes = []
442
442
_lib .llama_token_eos .restype = llama_token
443
443
444
444
445
- def llama_token_nl () -> llama_token :
445
+ def llama_token_nl () -> int :
446
446
return _lib .llama_token_nl ()
447
447
448
448
@@ -625,7 +625,7 @@ def llama_sample_token_mirostat(
625
625
eta : c_float ,
626
626
m : c_int ,
627
627
mu , # type: _Pointer[c_float]
628
- ) -> llama_token :
628
+ ) -> int :
629
629
return _lib .llama_sample_token_mirostat (ctx , candidates , tau , eta , m , mu )
630
630
631
631
@@ -651,7 +651,7 @@ def llama_sample_token_mirostat_v2(
651
651
tau : c_float ,
652
652
eta : c_float ,
653
653
mu , # type: _Pointer[c_float]
654
- ) -> llama_token :
654
+ ) -> int :
655
655
return _lib .llama_sample_token_mirostat_v2 (ctx , candidates , tau , eta , mu )
656
656
657
657
@@ -669,7 +669,7 @@ def llama_sample_token_mirostat_v2(
669
669
def llama_sample_token_greedy (
670
670
ctx : llama_context_p ,
671
671
candidates , # type: _Pointer[llama_token_data_array]
672
- ) -> llama_token :
672
+ ) -> int :
673
673
return _lib .llama_sample_token_greedy (ctx , candidates )
674
674
675
675
@@ -684,7 +684,7 @@ def llama_sample_token_greedy(
684
684
def llama_sample_token (
685
685
ctx : llama_context_p ,
686
686
candidates , # type: _Pointer[llama_token_data_array]
687
- ) -> llama_token :
687
+ ) -> int :
688
688
return _lib .llama_sample_token (ctx , candidates )
689
689
690
690
0 commit comments