Skip to content

Commit

Permalink
Bug fix: Failed to load model using GQA
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongkaifu committed Oct 7, 2024
1 parent 7e8fee2 commit 5d38ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Seq2SeqSharp/Applications/Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public static MultiProcessorNetworkWrapper<IDecoder> CreateDecoders(IModel model
decoder = new MultiProcessorNetworkWrapper<IDecoder>(
new GPTDecoder("GPTDecoder", model.MultiHeadNum, model.HiddenDim, model.IntermediateDim, model.DecoderEmbeddingDim, model.DecoderLayerDepth, options.DropoutRatio, raDeviceIds.GetNextItem(),
isTrainable: options.IsDecoderTrainable && (options.Task == ModeEnums.Train), learningRateFactor: options.DecoderStartLearningRateFactor, activateFunc: model.ActivateFunc, expertNum: model.ExpertNum,
expertsPerTokenFactor: model.ExpertsPerTokenFactor, elementType: elementType, peType:model.PEType, normType: model.NormType, attentionType: options.AttentionType, multiHeadAttentionType: options.MultiHeadAttentionType,
KVGroupNum: options.KVGroupNum), raDeviceIds.ToArray());
expertsPerTokenFactor: model.ExpertsPerTokenFactor, elementType: elementType, peType:model.PEType, normType: model.NormType, attentionType: options.AttentionType, multiHeadAttentionType: model.MultiHeadAttentionType,
KVGroupNum: model.KVGroupNum), raDeviceIds.ToArray());
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions Seq2SeqSharp/Models/IModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public interface IModel

public int MaxSegmentNum { get; set; }

public MultiHeadAttentionTypeEnums MultiHeadAttentionType { get; set; }
public int KVGroupNum { get; set; }

public void AddWeights(string name, float[] weights);

public float[] GetWeights(string name);
Expand Down

0 comments on commit 5d38ec5

Please sign in to comment.