
* add build to .dockerignore * test: only build one arch * add build to .gitignore * fix ccache path * filter amdgpu targets * only filter if autodetecting * Don't clobber gpu list for default runner This ensures the GPU specific environment variables are set properly * explicitly set CXX compiler for HIP * Update build_windows.ps1 This isn't complete, but is close. Dependencies are missing, and it only builds the "default" preset. * build: add ollama subdir * add .git to .dockerignore * docs: update development.md * update build_darwin.sh * remove unused scripts * llm: add cwd and build/lib/ollama to library paths * default DYLD_LIBRARY_PATH to LD_LIBRARY_PATH in runner on macOS * add additional cmake output vars for msvc * interim edits to make server detection logic work with dll directories like lib/ollama/cuda_v12 * remove unncessary filepath.Dir, cleanup * add hardware-specific directory to path * use absolute server path * build: linux arm * cmake install targets * remove unused files * ml: visit each library path once * build: skip cpu variants on arm * build: install cpu targets * build: fix workflow * shorter names * fix rocblas install * docs: clean up development.md * consistent build dir removal in development.md * silence -Wimplicit-function-declaration build warnings in ggml-cpu * update readme * update development readme * llm: update library lookup logic now that there is one runner (#8587) * tweak development.md * update docs * add windows cuda/rocm tests --------- Co-authored-by: jmorganca <jmorganca@gmail.com> Co-authored-by: Daniel Hiltgen <daniel@ollama.com>
31 lines
910 B
C++
Vendored
31 lines
910 B
C++
Vendored
#pragma once
|
|
|
|
#ifndef __cplusplus
|
|
#error "This header is for C++ only"
|
|
#endif
|
|
|
|
#include <memory>
|
|
|
|
#include "llama.h"
|
|
|
|
struct llama_model_deleter {
|
|
void operator()(llama_model * model) { llama_free_model(model); }
|
|
};
|
|
|
|
struct llama_context_deleter {
|
|
void operator()(llama_context * context) { llama_free(context); }
|
|
};
|
|
|
|
struct llama_sampler_deleter {
|
|
void operator()(llama_sampler * sampler) { llama_sampler_free(sampler); }
|
|
};
|
|
|
|
struct llama_lora_adapter_deleter {
|
|
void operator()(llama_lora_adapter * lora_adapter) { llama_lora_adapter_free(lora_adapter); }
|
|
};
|
|
|
|
typedef std::unique_ptr<llama_model, llama_model_deleter> llama_model_ptr;
|
|
typedef std::unique_ptr<llama_context, llama_context_deleter> llama_context_ptr;
|
|
typedef std::unique_ptr<llama_sampler, llama_sampler_deleter> llama_sampler_ptr;
|
|
typedef std::unique_ptr<llama_lora_adapter, llama_lora_adapter_deleter> llama_lora_adapter_ptr;
|