File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
src/main/java/com/example/model/qwen2 Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .example .model .qwen2 ;
2
+
3
+ import com .example .model .Configuration ;
4
+
5
+ public record Qwen2Configuration (int dim ,
6
+ int hiddenDim ,
7
+ int numberOfLayers ,
8
+ int numberOfHeads ,
9
+ int numberOfKeyValueHeads ,
10
+ int numberOfHeadsKey ,
11
+ int numberOfHeadsValue ,
12
+ int vocabularySize ,
13
+ int contextLengthModel ,
14
+ int contextLength ,
15
+ boolean sharedWeights ,
16
+ float rmsNormEps ,
17
+ float ropeTheta ) implements Configuration {
18
+ @ Override
19
+ public int headSize () {
20
+ return dim / numberOfHeads ;
21
+ }
22
+
23
+ @ Override
24
+ public int kvDim () {
25
+ return (dim * numberOfKeyValueHeads ) / numberOfHeads ;
26
+ }
27
+
28
+ @ Override
29
+ public int kvMul () {
30
+ throw new UnsupportedOperationException ("Not supported for Qwen2." );
31
+ }
32
+
33
+ @ Override
34
+ public int contextLengthModel () {
35
+ return contextLengthModel ;
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments