TP: fix Phi3, Bert, Plamo2/3, ChatGLM (#25536)

This commit is contained in:
Johannes Gäßler authored and GitHub committed 2026-07-16 16:23:23 +03:00
1 parent 86b719bf21
commit 2e1fd76490
2 files changed
+19 -6

No files matched your search

+3 -1
View File
@@ -40,8 +40,10 @@ static double nmse(const std::vector<float> & a, const std::vector<float> & b) {
}
static void set_tensor_data(struct ggml_tensor * tensor, void * userdata) {
size_t seed = *(const size_t *) userdata;
std::hash<std::string> hasher;
std::mt19937 gen(hasher(tensor->name) + *(const size_t *) userdata);
seed ^= hasher(tensor->name);
std::mt19937 gen(seed);
std::normal_distribution<float> dis(0.0f, 1.0e-2f);
const int64_t ne = ggml_nelements(tensor);