mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(feature)(chat)agent记忆管理启用的few-shot优先,避免shffle过程的随机性导致被全局的few-shot替代
This commit is contained in:
@@ -51,7 +51,9 @@ public class PromptHelper {
|
||||
// use random collection of exemplars for each self-consistency inference
|
||||
for (int i = 0; i < selfConsistencyNumber; i++) {
|
||||
List<Text2SQLExemplar> shuffledList = new ArrayList<>(exemplars);
|
||||
Collections.shuffle(shuffledList);
|
||||
// only shuffle the exemplars from config
|
||||
List<Text2SQLExemplar> subList=shuffledList.subList(llmReq.getDynamicExemplars().size(),shuffledList.size());
|
||||
Collections.shuffle(subList);
|
||||
results.add(shuffledList.subList(0, Math.min(shuffledList.size(), fewShotNumber)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user