You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: generateSummary.m
    path of file: ./repos/transformer-models
    
    the code of the file until where you have to start completion: function summary = generateSummary(mdl, text, nameValueArguments)
% GENERATESUMMARY   Generate summary of text with GPT-2
%
%   summary = GENERATESUMMARY(mdl, text) generates a summary of the
%   string or char array text using the transformer model mdl. The output
%   summary is a char array.
%
%   summary = GENERATESUMMARY(mdl, text, 'PARAM1', 'VAL1', ...)
%   specifies optional name/value pairs for creating the summary:
%
%   'MaxSummaryLength'      - The maximum number of tokens in the generated
%                             summary. The default is 50.
%   'TopK'                  - The number of tokens to sample from when

    
function summary = generateSummary(mdl, text, nameValueArguments)
% GENERATESUMMARY   Generate summary of text with GPT-2
%
%   summary = GENERATESUMMARY(mdl, text) generates a summary of the
%   string or char array text using the transformer model mdl. The output
%   summary is a char array.
%
%   summary = GENERATESUMMARY(mdl, text, 'PARAM1', 'VAL1', ...)
%   specifies optional name/value pairs for creating the summary:
%
%   'MaxSummaryLength'      - The maximum number of tokens in the generated
%                             summary. The default is 50.
%   'TopK'                  - The number of tokens to sample from when
%                             generating the summary. The default is 2.
%   'Temperature'           - Temperature applied to the GPT-2 output
%                             probability distribution. The default is 1.
%   'StopCharacter'         - If the model generates this character its
%                             summary is finished. The default is '.'.

%   Copyright 2020 The MathWorks, Inc.

arguments
    mdl
    text                                      {iIsScalarString}
    nameValueArguments.MaxSummaryLength (1,1) {mustBeInteger, mustBePositive} = 50
    nameValueArguments.TopK             (1,1) {mustBeInteger, mustBePositive} = 2
    nameValueArguments.Temperature      (1,1) {mustBePositive} = 1
    nameValueArguments.StopCharacter          {iIsScalarString} = '.'
end