mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(fix)(headless)Avoid IndexOutOfBound exception in some cases.
This commit is contained in:
@@ -49,7 +49,7 @@ public class PromptHelper {
|
||||
for (int i = 0; i < selfConsistencyNumber; i++) {
|
||||
List<Text2SQLExemplar> shuffledList = new ArrayList<>(exemplars);
|
||||
Collections.shuffle(shuffledList);
|
||||
results.add(shuffledList.subList(0, fewShotNumber));
|
||||
results.add(shuffledList.subList(0, Math.min(shuffledList.size(), fewShotNumber)));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user