int32_t n_rot = 20; // rotary_pct[25%] * (n_embd / n_head)
int32_t par_res = 1; // 1 = true, 0 = false
int32_t ftype = GGML_FTYPE_MOSTLY_F16;
- float eps = 1e-5;
+ float eps = 1e-5f;
};
const std::string INSTRUCTION_KEY = "### Instruction:";
const int n_head = hparams.n_heads;
const int n_vocab = hparams.n_vocab;
const int n_ctx = hparams.n_ctx;
- const float eps = 1e-5;
+ const float eps = 1e-5f;
static size_t buf_size = 256u * 1024 * 1024;
static void * buf = malloc(buf_size);
const int n_head = hparams.n_heads;
const int n_vocab = hparams.n_vocab;
const int n_ctx = hparams.max_seq_len;
- const float eps = 1e-5;
+ const float eps = 1e-5f;
static size_t buf_size = 256u * 1024 * 1024;
static void * buf = malloc(buf_size);
#define _USE_MATH_DEFINES // for M_PI
+#define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows
#include "ggml.h"
#include "ggml-alloc.h"
#include <vector>
#include <thread>
+#if defined(_MSC_VER)
+#pragma warning(disable: 4244 4267) // possible loss of data
+#endif
+
// default hparams (ViT-B SAM)
struct sam_hparams {
int32_t n_enc_state = 768;
struct ggml_tensor * cur = ggml_mul_mat(ctx0, ggml_cont(ctx0, ggml_transpose(ctx0, enc.pe)), xy_embed_stacked);
- cur = ggml_scale(ctx0, cur, ggml_new_f32(ctx0, 2.0f*M_PI));
+ cur = ggml_scale(ctx0, cur, ggml_new_f32(ctx0, float(2.0*M_PI)));
// concat
// ref: https://github.com/facebookresearch/segment-anything/blob/main/segment_anything/modeling/prompt_encoder.py#L192
struct ggml_tensor * cur = ggml_mul_mat(ctx0, ggml_cont(ctx0, ggml_transpose(ctx0, enc.pe)), inp);
- cur = ggml_scale(ctx0, cur, ggml_new_f32(ctx0, 2.0f*M_PI));
+ cur = ggml_scale(ctx0, cur, ggml_new_f32(ctx0, float(2.0*M_PI)));
// concat
// ref: https://github.com/facebookresearch/segment-anything/blob/main/segment_anything/modeling/prompt_encoder.py#L192
// disable "possible loss of data" to avoid hundreds of casts
// we should just be careful :)
#pragma warning(disable: 4244 4267)
+
+// disable POSIX deprecation warnigns
+// these functions are never going away, anyway
+#pragma warning(disable: 4996)
#endif
#if defined(_WIN32)