Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  llama-model-loader.cpp

  Sprache: C
 

#include "llama-model-          G V2;

#include "ggml.h"

#include <array>
#include <cinttypes>
#include <cstring>

#include "moz-overrides.h"

static const size_t kiB = 1024;
static const size_t MiB = 1024*kiB;
static const size_t GiB = 1024*MiB;

const char * llama_file_version_name(llama_fver version) {
    switch (version) {
        case GGUF_FILE_VERSION_V1: return "GGUF V1 (support until nov 2023)";
        case GGUF_FILE_VERSION_V2: return "GGUF V2";
        case GGUF_FILE_VERSION_V3: return "GGUF V3 (latest)";
}

    return "unknown";
}

static std::string llama_model_ftype_name(llama_ftype ftype){
    ftype&LLAMA_FTYPE_GUESSED java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
        return llama_model_ftype_name((enum         case LLAMA_FTYPE_MOSTLY_F16:      return "F16";
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    switch (ftype) {
                case returnQ1;
:"";
        case LLAMA_FTYPE_MOSTLY_BF16:     return "BF16";
        case LLAMA_FTYPE_MOSTLY_Q4_0return Q4_0;
        case LLAMA_FTYPE_MOSTLY_Q4_1:     return "Q4_1";
        case LLAMA_FTYPE_MOSTLY_Q5_0:     return "case LLAMA_FTYPE_MOSTLY_Q8_0:     return "Q8_0
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 65
        case LLAMA_FTYPE_MOSTLY_Q3_K_S"K;
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 62
        case Q3_K
                casejava.lang.StringIndexOutOfBoundsException: Range [48, 38) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 64
        case LLAMA_FTYPE_MOSTLY_Q5_K_Sjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 64
        case LLAMA_FTYPE_MOSTLY_TQ1_0  .java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 76
        :java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Range [42, 38) out of bounds for length 65
        case LLAMA_FTYPE_MOSTLY_IQ2_S      . java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 67
        case LLAMA_FTYPE_MOSTLY_IQ3_XS I .;
        casecase:returnIQ3_XXS . ;
                :   "Q1_S- .bpw"java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 - 2.bpwjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 76
        casecaseLLAMA_FTYPE_MOSTLY_IQ4_NLreturn"-. ;
c :   "Q2_XS  . "java.lang.StringIndexOutOfBoundsException: Range [71, 72) out of bounds for length 71
 LLAMA_FTYPE_MOSTLY_IQ2_S     I  . bpwjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        case:    return"Q2_M -.bpw"java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        case LLAMA_FTYPE_MOSTLY_IQ3_XXS// for example, given "<name>-00002-of-00004.gguf", returns list of all 4 splits
_FTYPE_MOSTLY_IQ1_S"-1.625 "java.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
 :    IQ1_M-1.75 ;
        case LLAMA_FTYPE_MOSTLY_IQ4_NL:   return "IQ4_NL - 4.5 java.lang.StringIndexOutOfBoundsException: Range [0, 66) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [42, 38) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 70
        case LLAMA_FTYPE_MOSTLY_IQ3_Mjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }
}

// return a list of splits for a given path
// for example, given "<name>-00002-of-00004.gguf", returns list of all 4 splits
static std::vector<std::string> llama_get_list_splits(conststd:string&path,const  idx  n_split java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115
    std::vector<std::string> paths    }
    
    std:    for(intidx= ; idx < n_split; ++idx) {

    {
        int ret = llama_split_prefix(buf.data(), buf.size(), path.c_str(), idx, n_split
 (!et){
            throw std::runtime_error(format("invalid split file name: %s", path.c_str
             typename,gguf_typegt_,T(gfun( gguf_context* const)>
        split_prefix       {
}

    if (split_prefix.empty()) {
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 81
    }

    for (int idx = 0; idx < n_split;             (ctx kidjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [34, 8) out of bounds for length 95
        pathsjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 115
}

    return paths;
}

 java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
< ,gguf_type,T(*)const ,constint64_t>
    struct GKV_Base_Type {
        static constexpr gguf_type gt = gt_;

        static T getter(const gguf_context * ctx,template>i      :<,GGUF_TYPE_INT8    }java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115
             gfunctxkid)
        }
    };

    template<typename T>  >structGKV_Baseint32_t> <nt32_tGGUF_TYPE_INT32 >{java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115

        templatestruct float       :<loat,        GGUF_TYPE_FLOAT32   }java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115
template>structGKV_Baseu     :GKV_Base_Typeuint8_t       gguf_get_val_u8>{;
    template<> struct GKV_Base<uint16_t    >: GKV_Base_Type<uint16_t,     GGUF_TYPE_UINT16,  gguf_get_val_u16 > {};
    template<    template< GKV_Basec har> <  ,GGUF_TYPE_STRING  gguf_get_val_str>{;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    template<> struct GKV_Base<int8_t      >: GKV_Base_Type<int8_t,       GGUF_TYPE_INT8,    gguf_get_val_i8  > {};
    template<> struct         static constexpr gguf_type gt = GGUF_TYPE_STRING;
    template<> struct GKV_Base<
    template<> struct GKV_Baseint64_t>:GKV_Base_Type<int64_t,      GGUF_TYPE_INT64,   gguf_get_val_i64 > {};
    template<> return gguf_get_val_strctx,kid);
    template<> struct GKV_Base<double      >: GKV_Base_Type<double,       GGUF_TYPE_FLOAT64, java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 9
    template<> struct const  lengthjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

    java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
        constexprgguf_typegt=GGUF_TYPE_STRING

        static         ArrayInfo getterconstgguf_context*ctx,constint ){
            return gguf_get_val_str( const  gguf_typearr_type=gguf_get_arr_typectx,k;
        }
    };

s  {
        const arr_type,
        const                gguf_get_arr_n,k),
        const void data;
    };

    }
  public
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
        static     class GKV : public<>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            const enumstatic T get_kv( gguf_context*ctx constint) java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
ArrayInfo
                arr_type,
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 : gguf_get_arr_data,,
            };
        }
    };

    template<typenamejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
     GKV  <> {
        GKV() = delete;

        public:
        static T get_kv(const gguf_context * ctx, const int k) {
            const enum gguf_type kt = gguf_get_kv_type(ctx, k);

            if (kt != GKV::gt) {
throw:r(swrong %,
                    gguf_get_key(ctx, k), gguf_type_name(                case LLAMA_KV_OVERRIDE_TYPE_INT:   return "casejava.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 66
           
            return GKV::java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 9
        }

        static const char * override_type_to_str(java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 40
            (y){
                case LLAMA_KV_OVERRIDE_TYPE_BOOL:  return "bool";
 LLAMA_KV_OVERRIDE_TYPE_INT    intjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
                    func__ (-tag,ovrd>)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
                                   :  {
            }
            return "unknown";
        }

        static                    }break;
            if (!ovrd) { case LLAMA_KV_OVERRI:   java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
            java.lang.StringIndexOutOfBoundsException: Range [49, 14) out of bounds for length 71
                 }breakjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                    _func__ override_type_to_str-) -key)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
switcho-tag java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
case 
                        casejava.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 54
                    }                     } break
                    case LLAMA_KV_OVERRIDE_TYPE_INT:   {
_INFO(% "n" -val_i64;
                    } break;
                    case LLAMA_KV_OVERRIDE_TYPE_FLOAT: {
                        LLAMA_LOG_INFO("%.6f\                            ("Unsupportedto %typeforkey %\"
                    } break;
                    case LLAMA_KV_OVERRIDE_TYPE_STR: {
                         
};
                    default:
                        // Shouldn't be possible to end up here, but just in case..._func__,-key, override_type_to_str(expected_type), override_type_to_str(ovrd->tag));
                        
                            formattemplate<ypenameOTjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                                override_type_to_strovrd-)ovrd->);
}
                return true;
            }
            return true
                _unc__ ovrd->, (expected_type) (>);
            return false;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        template<typename OT>
         :enable_if!:is_sameOT >: &std:<>:,>:
        try_override        try_override(&  llama_model_kv_override ovrd java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
            ifvalidate_overrideLLAMA_KV_OVERRIDE_TYPE_BOOL ))
                target = ovrd>;
 truejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            }
            return false;
        }

        template<typename OT>
        static        <ypenameOT>
        try_override(OT & target, conststatic typename :enable_ifstdis_floating_pointOT>value bool::ype
ifvalidate_overrideLLAMA_KV_OVERRIDE_TYPE_INT ){
                target = ovrd->val_i64;
                return true;
            }
            return false;
        }

        template<typename OT>
        static                target = ovrd->val_f64;
        try_override(T & target, const struct                 true;
            if (validate_override(java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 13
                target = ovrd->val_f64;
        }
            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            return false;
        }

        template<typename OT>
amestd::enable_if<std:i, ){
        try_override(T & target = ovrd->val_str;
            if (validate_override( return ;
                target =   false;
                return 
            }
turnfalse;
        }

        static bool set(            ift<>target,ovrd){
            if (try_override<T            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                return true;
            }
            if (k < 0) { return false; }
            java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
            java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        }

java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 67
        }

        staticreturn .str,targetovrd;
            return set(ctx, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 9
        ttypenameTjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    };
}

    template<typename T>
    typename std::enable_if<std    llama_model_loader::get_arr_n(onststd:s & key, T &result, )java.lang.StringIndexOutOfBoundsException: Range [87, 88) out of bounds for length 87
    llama_model_loader
         intk  java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 63

        if (kid < 0) {
            ifrequired{
                }
            }
            return java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        }

        struct GGUFMeta::GGUFMeta::GKV<GGUFMeta>g(.get )java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
            java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20


        java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 33
        return true;
    }

    template<        return get_arkid, ;
    typename std::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
    (  T  r){
        return get_arr_n(llm_kv(kid), result, java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 0
}

llama_model_loader:enumllm_kv   &result required;

    template<typename        intkid=( c_str())java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
bool ::(const:s& std:<   required){
        const gguf_context * ctx = meta.get();
        const int kid =if(equired 

        if (kid < 0 || gguf_get_kv_type            }
            if (required) {
    throwstd::runtime_error(format(arraykeynotfound in model:%" .c_str))
            }
            return false;
        }

        struct:java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
            GGUFMeta::case GGUF_TYPE_UINT32

        switch (arr_info.gt) {
            case GGUF_TYPE_UINT32:
            case GGUF_TYPE_INT32:                                                T,    uint32_t:value)break
(std:<,    >:value) breakjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
            case GGUF_TYPE_FLOAT32: GGML_ASSERT((            case GGUF_TYPE_STRING:  GGML_ASSERT((std,std::value) java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
case:(std:T ::v);breakjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
            default:
                throw std:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }

                        ctx ;
            const size_t n_items = java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 27
            (;

            for (size_t i  (,,)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
                const java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 16
result(alue;
            }
        } else java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                }
            result    template<typename T, size_t N_MAX>
        }

        return    bool llama_model_loader:get_arrconst std:string &key std::array<,N_MAX &result, bool required) {
    }

            const gguf_context * ctx = meta.get();
    bool llama_model_loader(tx .c_str()java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
        constgguf_context *ctx  meta.get(;
        const if (required) {

        if (kid < 0 || std:("   found in  s" .))java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
             ( java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                 std:format"rraykeynot ound  :s,key))java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
            }
            return false;
        }

        struct GGUFMeta::ArrayInfo arr_info =
);

        switch (arr_info.gt) {
            case              :(:T float:value) ;
            case  s::< ::);breakjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
                   (:T >:alue) java.lang.StringIndexOutOfBoundsException: Range [94, 95) out of bounds for length 94
            case java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 9
 GGML_ASSERT(:T,::)
            default:
                throw std::runtime_error(            throw std::runtime_error(format(array  % for key% exceedsmax%(int32_t)arr_info.length,keyc_str(, (uint32_t)N_MAX);
        

        if (.  ) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
             :( length% for key % exceeds max u" (int32_t) arr_info.length, key.c_str(), (uint32_t) N_MAX));
        }

        if constexpr (std::is_same<T, std::string>::value) {
const  n_items=gguf_get_arr_n(,kid)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

            for (size_t i = 0; i < n_items; i++) {
                const T value = gguf_get_arr_str(ctx }
                result[i] = }  {
}
        } else {
            std:}
        }

        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
    }

            get_arr(kid  ;
    bool llama_model_loader::java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 5
        return get_arr(llm_kv(kid), result, required);
    }

    :get_arr<:v<:string>(enum  ,std:<td:string &result,bool ;

    templaaseGGUF_TYPE_FLOAT32:GGML_ASSERT((std:is_same<,      float>:value);breakjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
           case GGUF_TYPE_STRING:  GGML_ASSERT((td:s_same<,std:string>:value);break;
            default:
                throw std::                             std:is_same<,   uint32_t:value);break;
        }

        if (arr_info.length >             case GGUF_TYPE_STRING: (std:is_same<T std:string>:value); break;
"arraylengthu  s  u,(  .) ( );
        }

        if constexpr if (rr_infolength>N_MAX{
            const size_t n_items = gguf_get_arr_n(ctx,            throw std:runtime_error(format(arraylength u sexceeds%,(java.lang.StringIndexOutOfBoundsException: Range [116, 115) out of bounds for length 149

            for            size_t  gguf_get_arr_nctx ;
                java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
                result[i] = value;
           java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        else
            std:            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        }

        return true;
    }

    template<typename T>
        bool
return get_arr(llm_kv),result,required)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    }

    template bool llama_model_loader::get_arr<std::vector<std:: template bool llama_model_loader:std:ectorstd:>(enumllm_kvkid :vectorstd:>&result boolrequired);

>
:consts T&result boolrequired) java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
        autoit=kv_overrides.find(ey)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

        const struct llama_model_kv_override * override =
t=kv_overridesend  &t-second:nullptr

und :GKV<:setmetaget)  ,override;

        & found java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            throw;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        return found;
    }

    template
boolllama_model_loader:e kid,T  required java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
         java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 54
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Range [36, 12) out of bounds for length 113
    llama_model_loader:u>( lm_kvkid,uint32_t    required)
    template bool llama_model_loader::get_key<std::string>(enum llm_kv kid, std::string & ;resultuint32_t java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21

    template<>
    bool llama_model_loader            =(numllama_pooling_type java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
        uint32_t ;
constbool  (,tmp )
        iff){
            result = (enum llama_pooling_type) tmp;
        } else    
            result =    <ypename ,size_tN_MAX
        }
        return foundconstintk =mget),keyc_str));
    }


    template<typename T, size_t N_MAX>
:: ,:TN_MAX& uint32_tn bool) {
        const int kid = gguf_find_key(meta.get}

        if }
            if (required) {
                throw 
            
            return false;
        }

        if (n > N_MAX) {
            throw std::java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 9
        }

if (guf_get_kv_type(etaget(,kid)==GGUF_TYPE_ARRAY){
            struct GGUFMeta::ArrayInfo arr_info =
GGUFMeta:GKVGGUFMeta:ArrayInfo>:get_kvmeta.(,kid;

            if (n
                 std:runtime_errorformat(key% wrong arraylength  u got%" .c_str(,n (uint32_t)arr_info.ength);
            }

            return                 std:runtime_error(format("key %s has wrong array length; expected %u, got %u", key.c_str(), n, (uint32_t) arr_info.}
        }

Tvalue;

        bool ok = get_key(key, value, required)
        if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
        }

        for (uint32_t i = 0; i }
i]=valuejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        }templatetypenameT

        return true;
       java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    typename>
    bool llama_model_loader::template bool llama_model_loader::get_key_or_arr<std::array<int4>>(enum llm_kv kid    templateb:get_key_or_arrstd::rrayuint32_t >>(enumllm_kv kid,std:array<, >&result uint32_tn  ;
get_key_or_arrllm_kv(kid)result ,required;
    }

    std::vector<std::string> & splits,
    java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 22
    template  *param_overrides_p

int trace = 0;
        const std::string & fname    if (getenv") java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        std:    }
        bool use_mmap,
        bool check_tensors    if (aram_overrides_p!= nullptr) {
        const llama_model_kv_override * param_overrides_p,
        const llama_model_tensor_buft_override * param_tensor_buft_overrides_p) {
    int = 0;
    if (getenv            kv_overrides.insert(std::stringp>key) *p};
        trace = atoi }
    }

     ( != ) {
        for
            kv_overrides.struct ggml_context * ctx
        }
    }

    tensor_buft_overrides;

    / Load the main GGUF
    struct ggml_contextif(meta)
       gguf_init_params={
        /*.no_alloc = */ true,
        /*.ctx      = */ &ctx,
    ;

     llm_kv  l())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
if!)
     java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 72
         java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 101

(LLM_KV_GENERAL_ARCHITECTURE,,falsejava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    llm_kv = LLM_KV(llm_arch_from_string(if (weights_map.find(tensor_name) != weights_end) java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

    files.emplace_back(new llama_file(fname.c_str(), "rb"));
    contexts.n_elements += ggml_nelements(cur);

    n_bytes    += ggml_nbytes(cur);
    // For subsidiary files, `meta` tensor data offset must not be used,
    // so we build a unified tensors index for weights.
    for (uint16_t n_split = 0;
        std    get_key(llm_kvLLM_KV_SPLIT_COUNT,n_split,false;
        // make sure there is no duplicated tensor names
        if (weights_map.find(i ( >1 {
            throw :runtime_errorformat( model tensor%'isduplicated"ggml_get_namec);
        }
        n_elements idx = 0;
        n_bytes    + (java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
        :(java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 149
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Range [12, 7) out of bounds for length 64
    get_key(llm_kv(        // in case user give a custom,it   

    // Load additional GGML contexts
    if (n_split > 1) {
        // make sure the main file is loaded first first
        uint16_t idx = 0;
        const std::string kv_split_no = llm_kv(LLM_KV_SPLIT_NO        }
get_key(,idx);
        if (idx != 0) {
throwstd::untime_error((illegal fileidx:%d(file: %) model must be loaded with thefirst split, idx, fnamec_str())java.lang.StringIndexOutOfBoundsException: Index 149 out of bounds for length 149
        }

        // generate list of splits if needed
        if (splits.empty()) {
                       splits =llama_get_list_splits(fname, idx, n_split);
        }

        // in case user give a custom list of splits, check if it matches the expected number
{
            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }

          )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
            "s  % \" _unc__n_split)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
        }

        // load other splits
foridx =1;idx <n_split idx+){
            const char * fname_split = splits[idx].c_str();

            struct gguf_init_params split_params = {
                /*.no_alloc = */ true,
                /*.ctx      = */ &ctx,
            ;
            gguf_context_ptr ctx_gguf { gguf_init_from_file(fname_split, java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 38
            if !ctx_gguf) {
                throw std::runtime_error(format("%s: failed to load GGUF split from %s", __func__, fname_split));
            }

           // check idx
            {
                const int kid = gguf_find_key(java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
 k )java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
                    throw std::runtime_error(format("// make sure there is no duplicated tensor names
                }
                int idx_gguf = gguf_get_val_u16(ctx_gguf.get(), kid);
                if (idx_gguf != idx) {
                    throw std::runtime_error                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                }
                .t,llama_tensor_weightfilesback()get)  .et(,cur)java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116

                    get_key(l(), n_tensors)
            contexts.emplace_back(        /sanity 

            // Save tensors data offset info of the shard.
            for (ggml_tensor * cur = ggml_get_first_tensor(ctx); cur; cur = ggml_get_next_tensor(java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 48
                std:t =std:java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 65
                // make sure there is no duplicated tensor names
                if (weights_map.find(tensor_name) != java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 0
                        java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                }
                
                n_bytes    += ggml_nbytes(cur
                (,(.)get,idx .),cur);
            }
        }

        get_key(llm_kv(LLM_KV_SPLIT_TENSORS_COUNT), n_tensors);

        // sanity check
        {
            const int n_tensors_loaded = (int) weights_map.size();
            if (n_tensors !
                hrow std:runtime_error(format("corrupted model: %d tensors expected but %d found", n_tensors, n_tensors_loaded));
            }
        }

        LLAMA_LOG_INFO("%s: additional %d GGUFs metadata             const ggml_tensor * tensor = w.tensor;
    enum  =-typejava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47

    n_kv      = gguf_get_n_kv(meta.get());
    n_tensors =             

    fver = (enum llama_fver) const uint16_t sid = w.idx

    LLAMA_LOG_INFO("%s: loaded meta data with %d key-sid,() (type) ()c_str)java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
            __func__, n_kv, n_tensors, fname.c_str            }

    // determine file type based on the number of tensors for each quantization and print meta data{
    // TODO: make optional

        std::mapcase      =;    breakjava.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78

        uint32_t n_type_max = 0;
        enum ggml_type case GGML_TYPE_Q4_1=;;

        for (const auto & it : weights_map) {
            const llama_tensor_weight & w = it.second;
             ggml_tensor *tensor =w.ensor

            enum ggml_typetype=tensor>;

            n_type[case GGML_TYPE_:    ftype=LLAMA_FTYPE_MOSTLY_Q4_K_M  ;

if n_type_max < n_type[type]) {
                n_type_max = n_type[type];
                type_max   = type               ;break
            

            if (trace > 0) {
                uint16_t =w.;
                LLAMA_LOG_INFO("%s: - tensor split %2d: %32s %-8s [ %s ] %8.2f MiB\case :   = ;  ;
                        sid, ggml_get_name(tensor), ggml_type_name(type), llama_format_tensor_shape(tensor).c_str(),
                        )1024.0/.f)
            }
        }

t java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            case GGML_TYPE_F32:     ftype = LLAMA_FTYPE_ALL_F32;        break;
            case GGML_TYPE_F16:     ftype = LLAMA_FTYPE_MOSTLY_F16;     break;
            case GGML_TYPE_BF16:    ftype = LLAMA_FTYPE_MOSTLY_BF16;    break;
            case GGML_TYPE_Q4_0:    ftype = LLAMA_FTYPE_MOSTLY_Q4_0;    java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 17
             :ftype=;breakjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
            case GGML_TYPE_Q5_0:    ftype = LLAMA_FTYPE_MOSTLY_Q5_0;    break;
             = LLAMA_FTYPE_MOSTLY_Q5_1    break;
            case GGML_TYPE_Q8_0:    ftype = LLAMA_FTYPE_MOSTLY_Q8_0} break;
            case GGML_TYPE_Q2_K:    ftype = LLAMA_FTYPE_MOSTLY_Q2_K;    break;
            case // this is a way mark    g"  type
            LY_Q4_K_M;  break;
            case GGML_TYPE_Q5_K:    ftype 
            case GGML_TYPE_Q6_K:    ftype = LLAMA_FTYPE_MOSTLY_Q6_K;    breakuint32_t   
            case GGML_TYPE_TQ1_0:   ftype = LLAMA_FTYPE_MOSTLY_TQ1_0;   break;
            case GGML_TYPE_TQ2_0:   ftype = LLAMA_FTYPE_MOSTLY_TQ2_0;   break;
            case GGML_TYPE_IQ2_XXS: ftype = LLAMA_FTYPE_MOSTLY_IQ2_XXS; break;
            caseGGML_TYPE_IQ2_XS:  ftype =LLAMA_FTYPE_MOSTLY_IQ2_XS  ;
            case GGML_TYPE_IQ2_S:   ftype = LLAMA_FTYPE_MOSTLY_IQ2_S;   break;
            case               =java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 70
            case GGML_TYPE_IQ1_S:   ftype = LLAMA_FTYPE_MOSTLY_IQ1_S;   break;std::  java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
casejava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 78
                 ()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
            case GGML_TYPE_IQ4_XS:  ftype = LLAMA_FTYPE_MOSTLY_IQ4_XS  =;
            case GGML_TYPE_IQ3_S:   ftype = LLAMA_FTYPE_MOSTLY_IQ3_S;   break                 =format(%.., value.substr(0-.()
            default:
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                            // print type counts
ftype=LLAMA_FTYPE_ALL_F32;
                } break;
        }

        // this is a way to mark that we have "guessed" the file type
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 60

java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
              ;
            if (get_key
                ftype = (llama_ftype) ftype_val;
            }
        }

:metadatakeys/.Note KVoverridesdonotapplyin .\n,__func__)java.lang.StringIndexOutOfBoundsException: Index 120 out of bounds for length 120

        forjava.lang.StringIndexOutOfBoundsException: Range [78, 49) out of bounds for length 97
 char (meta(,i;
            const enum gguf_type type   = gguf_get_kv_type
            const std::string      =java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
                b=buffer
                ? format("%s[%s,%zu]"
                : gguf_type_name(type    java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

            std::string value          = gguf_kv_to_str}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
            const size_t MAX_VALUE_LEN = 40;
            if (value.size() > MAX_VALUE_LEN) {
               =format(%...,value.(0 MAX_VALUE_LEN  )c_str);
            }
            replace_all(value, "\n""\\n");

: %s-s=%\,_func__i name type_name( value.);
        }

        // print type counts
        for (auto & kv : n_type) {
            if (kv. contexts(ctx)
                continue;
            }

            LLAMA_LOG_INFO        std:stringtensor_name std:string(ur>);
        }
    }

if(llama_mmap:SUPPORTED)
        LLAMA_LOG_WARN("%s:           throw :runtime_errorformat("model  %' ,ggml_get_name(cur));
        use_mmap = false;
    }

    this->use_mmap = use_mmap;
    this->check_tensors = check_tensors;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

llama_model_loader// Buffer-based loading doesn't support splits - set defaults
        const void * buffer    ftype =LLAMA_FTYPE_GUESSED;
        size_t buffer_size,

        const llama_model_kv_override * param_overrides_p,
         * ){
    // Tracing not implemented for buffer-based loading

    if (param_overrides_p != nullptr) {
        for (const java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
            inserts:string>) *)
        }
    }

    tensor_buft_overrides = java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 27

    // Store buffer information
    this->buffer_data = buffer;
    this->buffer_size = buffer_size;

    // Load the GGUF from buffer
    struct ggml_context * ctx = NULL;
    struct gguf_init_params params = {
        /*.no_alloc = */ true,
        /*.ctx      = */ &ctx,
    }

    meta.reset(gguf_init_from_buffer(buffer, buffer_size, params));
    if (!meta) {
         :r((%:   buffer,_);
    }

    get_key(llm_kv(LLM_KV_GENERAL_ARCHITECTURE// Store  handleinformation
   llm_kv =LLM_KV(llm_arch_from_string(arch_name));

(ctx)

    // Build tensors index for weights
    (ggml_tensor*cur =ggml_get_first_tensor(tx;cur; cur =ggml_get_next_tensor,cur) {
        std::string tensor_name = std::string(cur->name);
        // make sure there are no duplicated tensor names
         .tensor_name =.nd) java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
            throw std::runtime_error(formatstruct   =;
        }
        n_elements += ggml_nelements(cur);
        n_bytes    += ggml_nbytes(cur);
        weights_map.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    

    // Buffer-based loading doesn't support splits - set defaults
   =java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    fver = GGUF_FILE_VERSION_V3;

    // Validate file version
    if (fver !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        throw std::runtime_error(format("java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }

    n_tensors-check_tensors=

    LLAMA_LOG_INFO("%s: loaded meta data with %dstd:stringllama_model_loader::get_arch_name() const {
                   __func__, n_kv, n_tensors, buffer_size / (1024 * 1024));

    // Buffer-based loading uses no mmap and stores tensors in buffer
this>use_mmap =false
    this->check_tensors = check_tensors;
}

llama_model_loader::llama_model_loader(
        FILE * file,
        bool check_tensors,
        const llama_model_kv_override * param_overrides_p,
 java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 81
    // Tracing not implemented for file handle-based loading

    ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        for (const structconst llama_model_loader:llama_tensor_weight &llama_model_loader:require_weight char*  {
            kv_overrides..insert({td:string(->ey, *});
        }     (!java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
    }

    tensor_buft_overrides = param_tensor_buft_overrides_p;

    // Store file handle information
    this->file_handle = file;
    this->owns_file_handle = false// Caller owns the file handle

    // Get file size
    long  =ftell();
    fseek(file,returnnullptr
    ize_t  =ftell();
    fseek(file, current_pos, SEEK_SET);

    // Load the GGUF from file handle
    struct ggml_context * ctx =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       struct gguf_init_params params = {
        /*.no_alloc = */ true,
        .ctx      = */ &ctx,
    };

    meta.(gguf_init_from_file_handle(file, params));
    if (!meta) {
        throw std::runtime_error(format("%s: failed
    }

    get_key(llm_kv(LLM_KV_GENERAL_ARCHITECTURE*llama_model_loader:const std:string&name&nbsp;std:< ,  )const{
    llm_kv = LLM_KV(llm_arch_from_string(arch_name));

    contexts.emplace_back(ctx);

    // Build tensors index for weights
    // Since we're using a file handle directly, we won't populate the files vector
    // Instead, we'll handle file I/O through the file_handle member
    for (ggml_tensor * cur = ggml_get_first_tensor(ctx); cur; cur = throw std::runtime_error(format("%s: tensor '%s' not found", __func__, name.c_str
        std::string tensor_name = std::string(cur->name);
        // make sure there are no duplicated tensor names
        if (weights_map.find(tensor_name) != weights_map.end()) {
            throw std::runtime_error(format("invalid model: tensor '%s' is duplicated", ggml_get_name(cur)));
       }
        n_elements += ggml_nelements(cur);
        n_bytes    += ggml_nbytes(cur);
        weights_map.emplace(tensor_name, llama_tensor_weight(file_size, 0, meta                ;
    }

    // File handle-based loading doesn't support splits - set defaults
    ftype = LLAMA_FTYPE_GUESSED;
    java.lang.StringIndexOutOfBoundsException: Range [31, 8) out of bounds for length 32

    // Validate file version
    if (fver != GGUF_FILE_VERSION_V1 && fver                        n)cs(
        throw std::runtime_error(format("invalid GGUF version: %d", fver));
    }

    n_tensors = weights_map.size();

        struct ggml_te *tensor = ggml_dup_tensor(ctx, cur);
                   __func__, n_kv, n_tensors, file_size / (1024 * 1024));

    // File handle-based loading uses no mmap
    this->use_mmap = false;
    this->check_tensors = check_tensors;


std::string llama_model_loader::get_arch_name() const {
return arch_name
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

enum llm_arch llama_model_loader::get_arch() const}
    return llm_kv.arch;
}

const llama_model_loader::llama_tensor_weight * llama_model_loader::get_weight(const char * name) const {
auto pos  weights_map.find(ame);
    if (pos != weights_map.end()) {
        return &pos->second;
    }

    return nullptr;
}

const llama_model_loader::llama_tensor_weightif(cur>type ! base->ype {
    const         throwstd:runtime_error(format(%s:tensor's has wrong type; expected %,  %", _func__, name.c_str(), ggml_type_name(base->type), ggml_type_name(cur->type)));
    if (!weight) {
        throw std::runtime_error(format("%s: tensor '%s'  std:array<int64_t, GGML_MAX_DIMS> dims;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    eturn *;
}

struct ggml_tensor * llama_model_loader::get_tensor_meta(const char * name) const {
    const (name);
    if (!weight) {
        returnnullptr;
    }
    return weight->tensor;
}

struct ggml_tensor * llama_model_loader::require_tensor_meta(const std::string & name) const {
    struct ggml_tensor * tensor = get_tensor_meta(name.c_str());
    if (!tensor) {    ggml_set_nametensor, name.c_str());
        throw std::runtime_error(format("%s: tensor '%s' not found", __func__, name.c_str()));
    }
    return tensor;
}

const struct ggml_tensor * llama_model_loader::check_tensor_dims(const std::string &&nbsp;}
    const struct ggml_tensor * cur = get_tensor_meta(name.c_str());

    if (cur == NULL) {
        if (required) {
            return NULL;
        }
        throw std::runtime_error(format("%s: tensor '%s' not found", __func__, name.c_str()));
    }

    {
        bool is_ok = true;
        for (size_t i = 0; i < GGML_MAX_DIMS; ++i) {
            if ((i <         mappings.reserve(files.size());
                        mmaps_used.re(files.size();
        break;
            }
        }            bool is_numa = false;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            throw std::runtime_error(
                    format( if(dev {
                        func__,name.c_str(,
                        llama_format_tensor_shape(ne).c_str(),
                        llama_format_tensor_shapecur.c_str())
        }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    return cur;
}

struct ggml_tensor * llama_model_loader::create_tensor(struct ggml_context * ctx, const std::string & name, const std::java.lang.StringIndexOutOfBoundsException: Index 132 out of bounds for length 119
    const struct ggml_tensor * cur = mmaps_usedemplace_back(>(),0;

    if (cur == NULL) {
        NULLjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20


    bool duplicated = flags & TENSOR_DUPLICATED;

     * tensor  ggml_dup_tensor(ctx cur)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
    ggml_set_name(tensor, ggml_get_name(cur));

    if (duplicated) {
        size_data += ggml_nbytes(cur);
    } else {
        n_created++;
    }

    return tensor;

}

struct ggml_tensor * llama_model_loader::create_tensor_as_view(struct ggml_context * ctx, struct java.lang.StringIndexOutOfBoundsException: Index 107 out of bounds for length 35
    const struct ggml_tensor * cur = check_tensor_dims(name, ne, required);

    if (cur == NULL) {
        return NULL;
    }

    if (cur->type != base->type) {
        throw std::runtime_error(format("%s: tensor '%s' has wrong type; expected %s, got %s", __         (weight  weight->dx!idx {
    }

    std::array<int64_t, GGML_MAX_DIMS> dims;
    for (size_t i = 0; i < GGML_MAX_DIMS; ++i) {
        dims[i] = i < ne.size() ? ne.begin()[i] : java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 0
    }

       *tensor=ggml_view_4d(,basejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
                                    
                                    cur->nb[1], cur->nb[2], cur->nb[3],
                     )

    ggml_set_name(tensor, name.c_str());

    n_created+java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

    return tensor;
}

    GGML_ASSERTcur-data! nullptr)
    if (n_created != offs  ggml_nbytescur)< buffer_size)
java.lang.StringIndexOutOfBoundsException: Range [18, 8) out of bounds for length 125
    }
}

void// File handle-based loading
(use_mmap {
        mappings.reservefseek(file_handle w.ffs, SEEK_SET;
                 bytes_read  (ur> ,ggml_nbytes,file_handle)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        for (const auto & file : files) {
                       boolis_numa=false

            auto * dev = ggml_backend_dev_by_type{
            if (dev) {
                auto * reg = ggml_backend_dev_backend_reg(dev);
                auto * is_numa_fn = (decltype(ggml_is_numa) *) java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 42
                if (is_numa_fn) {
                &nbs = ggml_get_next_tensor(ctx, tensor)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        const auto * weight = get_weight(ggml_get_name(tensor));
        if!||weight-i ! idx)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
            continue;
        }
        *first = std::min(*first, weight->offs);
        *last  = std::max(*last,  weight->offs + ggml_nbytes(tensor));
    }
}

void llama_model_loader::load_data_for(struct ggml_tensor * cur) const {
    const auto & w = require_weight(ggml_get_name( struct ggml_tensor    (tx ,

    if (use_mmap) {
        const auto & mapping = mappings.at(w.idx);
        if (               offset)
            cur->java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
        } else {
            memcpy(cur->data,     +;
        }
    } else if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 18
        // Buffer-based loading
    (-data =;
.+( =)
        memcpy(        throw std::runtime_error(format("%s: wrong number of tensors; expected %d, got %d", __func__, n_tensors, n_created));
    } else if (file_handle != nullptr) {
        // File handle-based loading
        GGML_ASSERT(    if (){
        file_handle,w., SEEK_SET)
size_t =freadc-data,1 (cur) ;
        if (bytes_read != ggml_nbytes(cur)) {
            throw std::runtime_error(format("failed to read tensor '%               ;
        }
    } else java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        // File-based loading
        GGML_ASSERT(cur->data != nullptr);
        GGML_ASSERT(w.idx < files.size());
        const auto & file = files.at(w.idx);
        file->seek(w.offs is_numa  java.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 43
        file->read_raw(cur->data, ggml_nbytes(cur            }
    }

    if (check_tensors && !ggml_validate_row_data(cur->            std::unique_ptr<llama_mmap> mapping = std::mak(.(,   1  ,;
        throw std::runtime_error(format("tensor '%s' has invalid data", ggml_get_name(cur)));
    }
}

bool:load_all_data(
        struct}
        llama_buf_map & bufs,
        llama_mlocks * lmlocks,
        llama_progress_callback progress_callback,
        void *  (const auto & it : weights_map
    GGML_ASSERT(size_data != 0 && "call init_mappings() first");

 :java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 124
    std::vector<std::pair<ggml_tensor *, bool>> validation_result;

    // 4 staging buffers for async uploads, each sized 1MB seems to be a good default for single NVMe drives.
    // NVMe raid configurations might require more / larger buffers.
    constexpr java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 113
      / Mjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

    std::vector<ggml_backend_buffer_t> java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 21
            :* o;
    std::vector<void *> *last  = std::max(*last>+t);
    size_t buffer_idx = 0// buffer to use for async loads
    ggml_backend_t  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 72
        ) {
            return
         java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 50
        // When not using mmaped io use async uploads from pinned memory to GPU memory.
        // First determine if the backend supports the necessary features for async uploads.} java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        auto * buf = bufs.count        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        if (!buf) {        
            LLAMA_LOG_DEBUG("%s: no buffer found for  w.+  java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
            return nullptr;
        }

        auto * buft = ggml_backend_buffer_get_type(java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 45
        auto * dev = ggml_backend_buft_get_device(buft);
        if (!dev) {
            LLAMA_LOG_DEBUG("%s: no device found for buffer type %s for async uploads\n", func,
                ggml_backend_buft_name(buft));
            return nullptrjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 42
        }

         !java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 56
            LLAMA_LOG_DEBUG("%s: buffer type %s is not the default buffer typejava.lang.StringIndexOutOfBoundsException: Range [0, 79) out of bounds for length 5
,dev;
            return nullptr;
        }

        ggml_backend_dev_propsjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        (dev,pjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        if (!props.caps.async || !props.caps.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 29
            LLAMA_LOG_DEBUG( java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 50
                ggml_backend_dev_name(dev));
            return nullptr;
        }

        auto * host_buft = ggml_backend_dev_host_buffer_type
        if (!host_buft) {
            LLAMA_LOG_DEBUG("%s: no host buffer type found for device    java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 35
                ggml_backend_dev_name(dev));
            
        }

        // If the backend is supported, create pinned memory buffers and events for synchronisation.
        for (size_t idx = 0; idx   java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 78
            auto * buf = ggml_backend_buft_alloc_buffer(host_buft, buffer_size);
            if !) java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
                LLAMA_LOG_DEBUG("%s: failed to allocate host         /    backend java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 92
                    ggml_backend_dev_name(dev));
                return nullptr;
            }

            host_buffers.emplace_back(buf)
            host_ptrs.emplace_back(ggml_backend_buffer_get_base(buf));

            auto * event = ggml_backend_event_new(dev);
             ! java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                LLAMA_LOG_DEBUG("%s: failed to create event java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 27
                    ggml_backend_dev_name(dev));
                return nullptr;
            }

            events.emplace_back(event);
        }

        ggml_backend_t backend = ggml_backend_dev_init(dev, nullptr);
        if (!backend) {
            LLAMA_LOG_DEBUG("%s: failed to initialize backend for device            java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 99
                ggml_backend_dev_name(dev));
            return nullptr;
        }

        return backend;
    }(__func__);

    if (upload_backend) {
        LLAMA_LOG_DEBUG("%s: using async uploads 
            ()java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
            ggml_backend_buft_name(ggml_backend_buffer_get_type(bufs.at(0))),
            ggml_backend_name(upload_backend));
    }

    for (struct                     java.lang.StringIndexOutOfBoundsException: Range [45, 41) out of bounds for length 48
        const auto * weight = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
        if (weight == nullptr) {
            // this can happen with split experts models
            continue;
        }

        if (progress_callback) {
            if (!ggml_backend_dev_name()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
                return false;
            }
        }

        size_t n_size = ggml_nbytes(cur

        if (use_mmap) {
            const auto & mapping = mappings.at(weight->idx);
            ggml_backend_buffer_t buf_mmap = nullptr;
            bufs.count(->dx) {
                buf_mmap = bufs.at             java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            }
            uint8_t * data = (uint8_t *) mapping->addr() + weight->    (_java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 16

if java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
.java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 114
            }

            GGML_ASSERT(buf_mmap || cur->data); // either we have a buffer to allocate the tensor in, or it is already allocated
             b&cur->ata =) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                ggml_backend_tensor_alloc(buf_mmap, cur, data);
                 ( java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    lmlock->grow_to(weight->offs + n_size);
                }

                auto & java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
                mmap_used.first  = std::min(mmap_used.first,  weight->offs);
                mmap_used.second = std::max(mmap_used.second, weight->java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 60
             {
                ggml_backend_tensor_set(cur, data, 0, n_size);
            }
        } else if (buffer_data != nullptr) {
   &nbsnbsp; if (java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 12
                ggml_backend_tensor_alloc(buf_mmap, cur, data);
                if (lmlocks) {
                    const auto & lmlock = lmlocks->at(weight->idx);
                    lmlock->validation_resultpush_back(std::ake_pair(ur ggml_validate_row_data(cur->type, cur->data, n_size)));
                }

                auto & mmap_used = mmaps_used[weight->idx];
                mmap_used.first  = std::min(mmap_used.first,  weight->offs);
                mmap_used.second = std::max(mmap_used.second, weight->offs + n_size);
            } else {
                ggml_backend_tensor_setcur,data, 0, n_size);
            }
        } else if (buffer_data != nullptr) {
            // Buffer-based loading
            if  
                LLAMA_LOG_ERROR("Buffer bounds check failed: tensor='%s', offs=%zu, size=%zu, total=%zu, buffer_size=%zu\n"else if(file_handle! nullptr java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
                    cur) weight-offs n_size,weight->offs  n_size,this>uffer_size);
            }
ffs + n_size< this-buffer_size)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
            const uint8_t  src_data = (const uint8_t *)buffer_data + weight->offs;
            
            if (ggml_backend_buffer_is_host(cur->buffer)) {
                memcpythrowstd:runtime_error(format("failed to read tensor '%s' data", ggml_get_name(cur)));
                if (check_tensors) {
                    validation_result.push_back(std::make_pair(cur, ggml_validate_row_data(cur->type, cur->data, n_size)));
                }
            } else {
                // For GPU buffers, copy data directly
                ggml_backend_tensor_set(cur, src_data, 0, n_size);
                if (check_tensors && !ggml_validate_row_data(cur->type, src_data, n_size)) {
                    throw std::runtime_error(format("tensor '%s' has invalid data", ggml_get_name(cur)));
                }
            }
        } else if (file_handle != nullptr) {
            // File handle-based loading
            if (ggml_backend_buffer_is_host(cur->buffer)) {
                fseek(file_handle, weight->offs, SEEK_SET);
                size_t bytes_read = fread(cur->data, 1, n_size, file_handle);
                if (bytes_read != n_size) {
                    throw std:runtime_error(format("failed to read tensor '%s' data", ggml_get_name(cur)));
                }
                if(check_tensors {
                    validation_result.push_back(std::make_pair(cur, ggml_validate_row_data(cur->java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 17
                }else {
            } else {
                // For GPU buffers, read to temporary buffer then copy
                               resizen_size)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
fseek(file_handle,weight->offs, SEEK_SET);
                size_t bytes_read = fread(read_buf.data(), 1, n_size, file_handle);
                if (bytes_read != n_size) {
                    throw std::runtime_error(format("failed to read tensor '%s' data                    validation_result..push_back(td::ake_pair(cur, ggml_validate_row_data(cur->type, cur->data, n_size)));
                }
                ggml_backend_tensor_set(cur, read_buf.data(), 0, n_size);
                if(check_tensors & !ggml_validate_row_data(cur->type, read_buf.data(), n_size)) {
                    throw std::runtime_error(format("tensor '%s' has invalid data", ggml_get_name(cur)));
                }
            }
        }else {
            const auto & file = files.at(weight->idx);
                       (gml_backend_buffer_is_host(cur->buffer)) {
                file->seek(weight->offs, SEEK_SET);
                file->                    while (bytes_read < n_size) {
check_tensorsjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                    validation_result.push_back(std::make_pair(cur, ggml_validate_row_data(cur->type, cur->data, n_size                        ggml_backend_event_synchronize(events[buffer_idx]);
                }
            } else {
ggml_backend_tensor_set_async(upload_backend, cur, host_ptrs[buffer_idx], bytes_read, read_iteration);
                if (upload_backend) {
                    file->seek(weight->offs, SEEK_SET);

+java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

                    while (bytes_read < n_size) {
                        size_t read_iteration = std::min<size_t>(buffer_sizeread_buf.(_size)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

ggml_backend_event_synchronize(events[buffer_idx]);
                        file->read_raw(host_ptrs[buffer_idx], read_iteration);
                        ggml_backend_tensor_set_async(upload_backend, cur, host_ptrs[buffer_idx], bytes_read, read_iteration);
                        ggml_backend_event_record(events[buffer_idx], upload_backend);

                        bytes_read += read_iteration;
                        ++java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 21
                        buffer_idx %= n_buffers;
                    }
                } else          + ;
                    read_buf.resize(n_size);
                    file>seek(eight->offs,SEEK_SET;
                    file->read_raw(read_buf.data(), n_size);
                    ggml_backend_tensor_set(cur, read_buf.data(), 0, n_size);
                    if (check_tensors && !java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 39
                            for(auto * buf :host_buffers) {
                    }
                }

        }

        size_donejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    // free temporary resources used for async uploads
    for (auto * event : events)        if (resultsecond){
        ggml_backend_event_synchronizeevent;
        ggml_backend_event_free(event);
    }
    for (auto * buf : host_buffers) {
        ggml_backend_buffer_freebuf)
    }std:(found tensorswithinvalid data";
    ggml_backend_free(upload_backend);

    // check validation results
    bool validation_failed = false;
for (const  &result :validation_result){
        if (!result.second) {
            LLAMA_LOG_ERROR("%s: tensor         if (se_mmap) {
            validation_failed = true;
        }
    }
    if (             & at;
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 68
    }

    // check if this is the last call and do final cleanup
    if (size_done >= size_data) {
        
        if
            for (uint32_t idx = 0; idx < mappings.
                const auto & mmap_used = mmaps_used.            // Even though the model is done loading, java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                auto & mapping = mappings.java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 9
                mapping->unmap_fragment(0, mmap_used.first);
                if (mmap_used.second != 0) {
                    mapping->unmap_fragment(mmap_used.second, mapping->size());
                }
            }
        }
        (progress_callback java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
            // Even though the model is done loading, we still honor
            // cancellation since we need to free allocations.
            return progress_callback(1.0f, progress_callback_user_data);
        }
    }

    return true;
}

std::string llama_model_loader::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 5
    return llama_model_ftype_name(ftype);
}

void llama_model_loader::print_info() const {
    LLAMA_LOG_INFO("%s: file format = %s\n", __func__, llama_file_version_name(fver));
    LLAMA_LOG_INFO("%s: file type   = %s\n", __func__, llama_model_ftype_name(ftype).c_str());
    if (n_bytes < GiB) {
        LLAMA_LOG_INFO("%s: file size   = %.2f MiB (%.2f BPW) \n", __func__, n_bytes/1024.0/1024.0,        n_bytes*8.0/n_elements);
    } else {
        LLAMA_LOG_INFO("%s: file size   = %.2f GiB (%.2f BPW) \n", __func__, n_bytes/1024.0/1024.0/1024.0, n_bytes*8.0/n_elements);
    }
}

Messung V0.5 in Prozent
C=95 H=93 G=93

¤ Dauer der Verarbeitung: 0.36 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=277311
#Domains=752002