mirror of https://github.com/alibaba/MNN.git
ensure penalty sampler to be the first one in mixed samplers
This commit is contained in:
parent
3941e19a81
commit
69ac2f8f04
|
|
@ -232,6 +232,17 @@ void Sampler::SamplerConfig::configMixed(std::shared_ptr<LlmConfig> llmConfig) {
|
|||
this->configSampler(samplerName, llmConfig);
|
||||
// std::cout << samplerName << " " << std::flush;
|
||||
}
|
||||
for (int i=1; i<mixedSamplers.size(); ++i) {
|
||||
// "penalty" can only locate at the first position
|
||||
if (mixedSamplers[i]=="penalty") {
|
||||
mixedSamplers.erase(mixedSamplers.begin()+i);
|
||||
i--;
|
||||
if (mixedSamplers[0]!="penalty") {
|
||||
mixedSamplers.insert(mixedSamplers.begin(), "penalty");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// std::cout << std::endl;
|
||||
// set select type
|
||||
// the final sampler select the token
|
||||
|
|
|
|||
Loading…
Reference in New Issue