Fix warnings
This commit is contained in:
parent
38eea116b8
commit
e29da07731
|
@ -222,6 +222,10 @@ endif()
|
|||
# Build libraries
|
||||
#
|
||||
|
||||
if (MSVC)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
add_subdirectory(ggml)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
|
|
2
ggml
2
ggml
|
@ -1 +1 @@
|
|||
Subproject commit bcf387f6049fc0a7823746b933c0a42fad7d383a
|
||||
Subproject commit 4856b5d30a8985cde31efe4a5bfcc77ac1df61a6
|
10
rwkv.cpp
10
rwkv.cpp
|
@ -126,13 +126,13 @@ void rwkv_exp_impl(const int n_cols, float * dest, const float * src) {
|
|||
|
||||
void rwkv_1_minus_x_impl(const int n_cols, float * dest, const float * src) {
|
||||
for (int i = 0; i < n_cols; i++) {
|
||||
dest[i] = 1.0 - src[i];
|
||||
dest[i] = 1.0F - src[i];
|
||||
}
|
||||
}
|
||||
|
||||
void rwkv_sigmoid_impl(const int n_cols, float * dest, const float * src) {
|
||||
for (int i = 0; i < n_cols; i++) {
|
||||
dest[i] = 1.0 / (1.0F + expf(-src[i]));
|
||||
dest[i] = 1.0F / (1.0F + expf(-src[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,8 +342,8 @@ struct rwkv_context * rwkv_init_from_file(const char * file_path, uint32_t n_thr
|
|||
// Verify order of dimensions
|
||||
struct ggml_tensor * emb = model->emb;
|
||||
RWKV_ASSERT_NULL(emb->n_dims == 2, "Unexpected dimension count of embedding matrix %d", emb->n_dims);
|
||||
RWKV_ASSERT_NULL(emb->ne[0] == model->n_embed, "Unexpected dimension of embedding matrix %d", emb->ne[0]);
|
||||
RWKV_ASSERT_NULL(emb->ne[1] == model->n_vocab, "Unexpected dimension of embedding matrix %d", emb->ne[1]);
|
||||
RWKV_ASSERT_NULL(emb->ne[0] == model->n_embed, "Unexpected dimension of embedding matrix %lld", emb->ne[0]);
|
||||
RWKV_ASSERT_NULL(emb->ne[1] == model->n_vocab, "Unexpected dimension of embedding matrix %lld", emb->ne[1]);
|
||||
|
||||
int32_t n_embed = model->n_embed;
|
||||
int32_t n_layer = model->n_layer;
|
||||
|
@ -789,7 +789,7 @@ bool rwkv_quantize_model_file(const char * model_file_path_in, const char * mode
|
|||
|
||||
printf("original size = %8.2f MB\n", total_size_orig / 1024.0 / 1024.0);
|
||||
printf("quantized size = %8.2f MB\n", total_size_new / 1024.0 / 1024.0);
|
||||
printf("compression ratio = %8.2f%\n", 1.0 * total_size_orig / total_size_new);
|
||||
printf("compression ratio = %8.2f%%\n", 1.0 * total_size_orig / total_size_new);
|
||||
|
||||
{
|
||||
int64_t sum_all = 0;
|
||||
|
|
Loading…
Reference in New Issue