fix bug in llama cv folds conversion, simplify code