llama : clean-up
This commit is contained in:
parent
dae3cae841
commit
fe28a7b9d8
5 changed files with 20 additions and 29 deletions
|
@ -3,24 +3,6 @@
|
||||||
#define LLAMA_API_INTERNAL
|
#define LLAMA_API_INTERNAL
|
||||||
#include "llama.h"
|
#include "llama.h"
|
||||||
|
|
||||||
#ifdef __has_include
|
|
||||||
#if __has_include(<unistd.h>)
|
|
||||||
#include <unistd.h>
|
|
||||||
#if defined(_POSIX_MAPPED_FILES)
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
#if defined(_POSIX_MEMLOCK_RANGE)
|
|
||||||
#include <sys/resource.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// bump if necessary
|
|
||||||
#define LLAMA_MAX_NODES 8192
|
|
||||||
#define LLAMA_MAX_LAYERS 512
|
|
||||||
#define LLAMA_MAX_EXPERTS 160 // DeepSeekV2
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#define LLAMA_ATTRIBUTE_FORMAT(...) __attribute__((format(gnu_printf, __VA_ARGS__)))
|
#define LLAMA_ATTRIBUTE_FORMAT(...) __attribute__((format(gnu_printf, __VA_ARGS__)))
|
||||||
|
|
|
@ -18,8 +18,6 @@ struct llama_sampling {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct llama_sampling * llama_get_sampling(struct llama_context * ctx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// internal API
|
// internal API
|
||||||
//
|
//
|
||||||
|
|
|
@ -62,7 +62,6 @@ struct llama_vocab {
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx);
|
const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx);
|
||||||
const struct llama_vocab * llama_get_vocab(const struct llama_model * model);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// internal API
|
// internal API
|
||||||
|
|
|
@ -36,6 +36,19 @@
|
||||||
// TODO: replace with ggml API call
|
// TODO: replace with ggml API call
|
||||||
#define QK_K 256
|
#define QK_K 256
|
||||||
|
|
||||||
|
#ifdef __has_include
|
||||||
|
#if __has_include(<unistd.h>)
|
||||||
|
#include <unistd.h>
|
||||||
|
#if defined(_POSIX_MAPPED_FILES)
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
#if defined(_POSIX_MEMLOCK_RANGE)
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
|
@ -87,6 +100,11 @@
|
||||||
#pragma warning(disable: 4244 4267) // possible loss of data
|
#pragma warning(disable: 4244 4267) // possible loss of data
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// bump if necessary
|
||||||
|
#define LLAMA_MAX_NODES 8192
|
||||||
|
#define LLAMA_MAX_LAYERS 512
|
||||||
|
#define LLAMA_MAX_EXPERTS 160 // DeepSeekV2
|
||||||
|
|
||||||
//
|
//
|
||||||
// helpers
|
// helpers
|
||||||
//
|
//
|
||||||
|
@ -16794,14 +16812,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
|
||||||
return &ctx->model.vocab;
|
return &ctx->model.vocab;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct llama_vocab * llama_get_vocab(const struct llama_model * model) {
|
|
||||||
return &model->vocab;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct llama_sampling * llama_get_sampling(struct llama_context * ctx) {
|
|
||||||
return &ctx->sampling;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
|
struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
|
||||||
return &ctx->grammar;
|
return &ctx->grammar;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
// TODO: prefix all symbols with "llama_"
|
||||||
|
|
||||||
struct codepoint_flags {
|
struct codepoint_flags {
|
||||||
enum {
|
enum {
|
||||||
UNDEFINED = 0x0001,
|
UNDEFINED = 0x0001,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue