File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
src/main/java/org/beehive/gpullama3/inference/weights/standard Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .beehive .gpullama3 .inference .weights .standard ;
2
+
3
+ import org .beehive .gpullama3 .core .model .GGMLType ;
4
+ import org .beehive .gpullama3 .core .model .tensor .ArrayFloatTensor ;
5
+ import org .beehive .gpullama3 .core .model .tensor .FloatTensor ;
6
+ import org .beehive .gpullama3 .inference .weights .Weights ;
7
+
8
+ public class Qwen2StandardWeights extends StandardWeights {
9
+ public final FloatTensor [] q_bias , k_bias , v_bias ;
10
+
11
+ public Qwen2StandardWeights (
12
+ FloatTensor token_embedding_table ,
13
+ FloatTensor [] rms_att_weight ,
14
+ FloatTensor [] wq ,
15
+ FloatTensor [] wk ,
16
+ FloatTensor [] wv ,
17
+ FloatTensor [] q_bias ,
18
+ FloatTensor [] k_bias ,
19
+ FloatTensor [] v_bias ,
20
+ FloatTensor [] wo ,
21
+ FloatTensor [] rms_ffn_weight ,
22
+ FloatTensor [] w1 ,
23
+ FloatTensor [] w2 ,
24
+ FloatTensor [] w3 ,
25
+ FloatTensor rms_final_weight ,
26
+ ArrayFloatTensor freq_cis_real ,
27
+ ArrayFloatTensor freq_cis_imag ,
28
+ FloatTensor wcls ,
29
+ GGMLType weightType ) {
30
+ // call to StandardWeights constructor
31
+ super (token_embedding_table ,
32
+ rms_att_weight ,
33
+ wq ,
34
+ wk ,
35
+ wv ,
36
+ wo ,
37
+ rms_ffn_weight ,
38
+ w1 ,
39
+ w2 ,
40
+ w3 ,
41
+ rms_final_weight ,
42
+ freq_cis_real ,
43
+ freq_cis_imag ,
44
+ wcls ,
45
+ weightType );
46
+ // init Qwen2-specific fields
47
+ this .q_bias = q_bias ;
48
+ this .k_bias = k_bias ;
49
+ this .v_bias = v_bias ;
50
+ }
51
+
52
+ @ Override
53
+ public GGMLType getWeightType () {
54
+ return weightType ;
55
+ }
56
+ }
You can’t perform that action at this time.
0 commit comments