llama_cpp_rs 0.3.0

Rust bindings for LLAMA.CPP inference
Documentation
Build #937645 2023-10-12 08:09:32
# rustc version
rustc 1.75.0-nightly (475c71da0 2023-10-11)# docs.rs version
docsrs 0.6.0 (0fb89707 2023-10-11)# build log
[INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/llama_cpp_rs-0.3.0/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/llama_cpp_rs-0.3.0/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:023092b8bfa974c7f3e45c5ce651cc8dd3afd5e76915d5995b8dacd3032bf956" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "-Z" "unstable-options" "--config" "build.rustdocflags=[\"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20231011-1.75.0-nightly-475c71da0\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`
[INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
[INFO] [stdout] 06060a3bb806d9bebe24a7b1a69257ac6ce406bded2da038a1e02c246e00b768
[INFO] running `Command { std: "docker" "start" "-a" "06060a3bb806d9bebe24a7b1a69257ac6ce406bded2da038a1e02c246e00b768", kill_on_drop: false }`
[INFO] [stderr] warning: Target filter specified, but no targets matched. This is a no-op
[INFO] [stderr] warning: ./llama.cpp/ggml.c:19672:13: warning: 'ggml_opt_get_grad' defined but not used [-Wunused-function]
[INFO] [stderr] warning: 19672 | static void ggml_opt_get_grad(int np, struct ggml_tensor * const ps[], float * g) {
[INFO] [stderr] warning:       |             ^~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/k_quants.c:205:14: warning: 'make_qkx1_quants' defined but not used [-Wunused-function]
[INFO] [stderr] warning:   205 | static float make_qkx1_quants(int n, int nmax, const float * restrict x, uint8_t * restrict L, float * restrict the_min,
[INFO] [stderr] warning:       |              ^~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./binding.cpp: In function 'int get_embeddings(void*, void*, float*)':
[INFO] [stderr] warning: ./binding.cpp:80:23: warning: 'int llama_eval(llama_context*, llama_token*, int32_t, int)' is deprecated: use llama_decode() instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:    80 |         if (llama_eval(ctx, embd_inp.data(), embd_inp.size(), n_past))
[INFO] [stderr] warning:       |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:423:30: note: declared here
[INFO] [stderr] warning:   423 |     LLAMA_API DEPRECATED(int llama_eval(
[INFO] [stderr] warning:       |                              ^~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp: In function 'int eval(void*, void*, char*)':
[INFO] [stderr] warning: ./binding.cpp:138:22: warning: 'int llama_eval(llama_context*, llama_token*, int32_t, int)' is deprecated: use llama_decode() instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   138 |     return llama_eval(ctx, tokens.data(), n_prompt_tokens, n_past);
[INFO] [stderr] warning:       |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:423:30: note: declared here
[INFO] [stderr] warning:   423 |     LLAMA_API DEPRECATED(int llama_eval(
[INFO] [stderr] warning:       |                              ^~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp: In function 'int llama_predict(void*, void*, char*, bool)':
[INFO] [stderr] warning: ./binding.cpp:282:19: warning: 'int llama_eval(llama_context*, llama_token*, int32_t, int)' is deprecated: use llama_decode() instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   282 |         llama_eval(ctx, tmp, 1, 0);
[INFO] [stderr] warning:       |         ~~~~~~~~~~^~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:423:30: note: declared here
[INFO] [stderr] warning:   423 |     LLAMA_API DEPRECATED(int llama_eval(
[INFO] [stderr] warning:       |                              ^~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp:353:31: warning: 'int llama_eval(llama_context*, llama_token*, int32_t, int)' is deprecated: use llama_decode() instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   353 |                 if (llama_eval(ctx, &embd[i], n_eval, n_past))
[INFO] [stderr] warning:       |                     ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:423:30: note: declared here
[INFO] [stderr] warning:   423 |     LLAMA_API DEPRECATED(int llama_eval(
[INFO] [stderr] warning:       |                              ^~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp:440:49: warning: 'void llama_sample_temperature(llama_context*, llama_token_data_array*, float)' is deprecated: use llama_sample_temp instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   440 |                         llama_sample_temperature(ctx, &candidates_p, temp);
[INFO] [stderr] warning:       |                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:621:31: note: declared here
[INFO] [stderr] warning:   621 |     LLAMA_API DEPRECATED(void llama_sample_temperature(
[INFO] [stderr] warning:       |                               ^~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp:446:49: warning: 'void llama_sample_temperature(llama_context*, llama_token_data_array*, float)' is deprecated: use llama_sample_temp instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   446 |                         llama_sample_temperature(ctx, &candidates_p, temp);
[INFO] [stderr] warning:       |                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:621:31: note: declared here
[INFO] [stderr] warning:   621 |     LLAMA_API DEPRECATED(void llama_sample_temperature(
[INFO] [stderr] warning:       |                               ^~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp:456:49: warning: 'void llama_sample_temperature(llama_context*, llama_token_data_array*, float)' is deprecated: use llama_sample_temp instead [-Wdeprecated-declarations]
[INFO] [stderr] warning:   456 |                         llama_sample_temperature(ctx, &candidates_p, temp);
[INFO] [stderr] warning:       |                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: In file included from ./llama.cpp/common/common.h:5,
[INFO] [stderr] warning:                  from ./binding.cpp:1:
[INFO] [stderr] warning: ./llama.cpp/llama.h:621:31: note: declared here
[INFO] [stderr] warning:   621 |     LLAMA_API DEPRECATED(void llama_sample_temperature(
[INFO] [stderr] warning:       |                               ^~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./llama.cpp/llama.h:31:36: note: in definition of macro 'DEPRECATED'
[INFO] [stderr] warning:    31 | #    define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
[INFO] [stderr] warning:       |                                    ^~~~
[INFO] [stderr] warning: ./binding.cpp:475:42: warning: cast from type 'const char*' to type 'char*' casts away qualifiers [-Wcast-qual]
[INFO] [stderr] warning:   475 |             if (!tokenCallback(state_pr, (char*)token_str.c_str()))
[INFO] [stderr] warning:       |                                          ^~~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] warning: ./binding.cpp: In function 'void* llama_allocate_params(const char*, int, int, int, int, float, float, float, int, bool, bool, int, int, const char**, int, float, float, float, float, int, float, float, bool, const char*, const char*, bool, bool, bool, const char*, const char*, bool)':
[INFO] [stderr] warning: ./binding.cpp:629:100: warning: unused parameter 'ignore_eos' [-Wunused-parameter]
[INFO] [stderr] warning:   629 |                             float top_p, float temp, float repeat_penalty, int repeat_last_n, bool ignore_eos, bool memory_f16, int n_batch, int n_keep, const char **antiprompt, int antiprompt_count,
[INFO] [stderr] warning:       |                                                                                               ~~~~~^~~~~~~~~~
[INFO] [stderr] warning: ./binding.cpp: In function 'void* load_model(const char*, int, int, bool, bool, bool, bool, bool, bool, int, int, const char*, const char*, bool)':
[INFO] [stderr] warning: ./binding.cpp:708:122: warning: unused parameter 'low_vram' [-Wunused-parameter]
[INFO] [stderr] warning:   708 | void *load_model(const char *fname, int n_ctx, int n_seed, bool memory_f16, bool mlock, bool embeddings, bool mmap, bool low_vram, bool vocab_only, int n_gpu_layers, int n_batch, const char *maingpu, const char *tensorsplit, bool numa)
[INFO] [stderr] warning:       |                                                                                                                     ~~~~~^~~~~~~~
[INFO] [stderr]  Documenting llama_cpp_rs v0.3.0 (/opt/rustwide/workdir)
[INFO] [stderr]     Finished dev [unoptimized + debuginfo] target(s) in 0.26s
[INFO] running `Command { std: "docker" "inspect" "06060a3bb806d9bebe24a7b1a69257ac6ce406bded2da038a1e02c246e00b768", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "06060a3bb806d9bebe24a7b1a69257ac6ce406bded2da038a1e02c246e00b768", kill_on_drop: false }`
[INFO] [stdout] 06060a3bb806d9bebe24a7b1a69257ac6ce406bded2da038a1e02c246e00b768