mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +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++) {
|
for (int i = 0; i < selfConsistencyNumber; i++) {
|
||||||
List<Text2SQLExemplar> shuffledList = new ArrayList<>(exemplars);
|
List<Text2SQLExemplar> shuffledList = new ArrayList<>(exemplars);
|
||||||
Collections.shuffle(shuffledList);
|
Collections.shuffle(shuffledList);
|
||||||
results.add(shuffledList.subList(0, fewShotNumber));
|
results.add(shuffledList.subList(0, Math.min(shuffledList.size(), fewShotNumber)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
Reference in New Issue
Block a user