Skip to content

Handle cases where a model does not repeat the function signature#184

Open
XZ-X wants to merge 1 commit intodeepseek-ai:mainfrom
XZ-X:fix
Open

Handle cases where a model does not repeat the function signature#184
XZ-X wants to merge 1 commit intodeepseek-ai:mainfrom
XZ-X:fix

Conversation

@XZ-X
Copy link

@XZ-X XZ-X commented Nov 4, 2024

This PR attempts to handle cases where a model does not repeat the function signature.

Note that the variable start denotes the position of the queried function signature, and it will be set to 0 the function signature is not found in a model's response.

Suppose that the query prompt is

// query prefix here
void strlen(string s){

If a model returns

    return s.length();
}

The original processing code yields

// query prefix here
    return s.length();

which fails to compile.

A possible fix (as proposed by this PR) is not to skip the function signature when it's not found in a model's response.
That is, instead of returning func_prefix + '\n' + body + '\n', the function returns question + '\n' + body when the signature is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant