use max scan token size to hold large objects

This commit is contained in:
Michael Yang 2023-07-28 11:43:25 -07:00
parent 6ed3ec0cb3
commit 9c7f30d31c

View file

@ -24,6 +24,7 @@ func Parse(reader io.Reader) ([]Command, error) {
var command, modelCommand Command var command, modelCommand Command
scanner := bufio.NewScanner(reader) scanner := bufio.NewScanner(reader)
scanner.Buffer(make([]byte, 0, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize)
scanner.Split(scanModelfile) scanner.Split(scanModelfile)
for scanner.Scan() { for scanner.Scan() {
line := scanner.Bytes() line := scanner.Bytes()