Update model paths to new directory structure and enhance model loading

This commit is contained in:
extio-de
2026-03-22 18:51:49 +01:00
parent 9d89c2e0af
commit e3551bf6fe
3 changed files with 26 additions and 10 deletions

View File

@@ -91,13 +91,15 @@ public class Data {
static List<String> scanModels() {
final List<String> result = new ArrayList<>();
try {
Files
.list(Path.of(props.getProperty("models")))
.filter(p -> p.getFileName().toString().endsWith(".gguf"))
.map(Path::toAbsolutePath)
.map(Path::toString)
.sorted()
.forEach(result::add);
try (var paths = Files.walk(Path.of(props.getProperty("models")))) {
paths
.filter(Files::isRegularFile)
.filter(p -> p.getFileName().toString().endsWith(".gguf"))
.map(Path::toAbsolutePath)
.map(Path::toString)
.sorted()
.forEach(result::add);
}
}
catch (final IOException e) {
e.printStackTrace();