Skip to content

Commit b476e73

Browse files
committed
Add model name to progress log
1 parent f550ec8 commit b476e73

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

core/deployment/src/main/java/io/quarkiverse/langchain4j/deployment/devservice/DevServicesOllamaProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void onNext(OllamaClient.PullAsyncLine line) {
122122
// avoid showing 100% for too long
123123
LOGGER.infof("Verifying and cleaning up\n", progress);
124124
} else {
125-
LOGGER.infof("Progress: %s%%\n", progress);
125+
LOGGER.infof("%s - Progress: %s%%\n", model, progress);
126126
}
127127
}
128128
}

model-providers/jlama/deployment/src/main/java/io/quarkiverse/langchain4j/jlama/deployment/JlamaProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void update(String filename, long sizeDownloaded, long totalSize) {
216216
// avoid showing 100% for too long
217217
LOGGER.infof("Verifying and cleaning up\n", progress);
218218
} else {
219-
LOGGER.infof("Progress: %s%%\n", progress);
219+
LOGGER.infof("%s - Progress: %s%%\n", modelName, progress);
220220
}
221221
}
222222

model-providers/llama3-java/deployment/src/main/java/io/quarkiverse/langchain4j/llama3/deployment/Llama3Processor.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import java.util.ArrayList;
1313
import java.util.List;
1414
import java.util.Optional;
15+
import java.util.concurrent.TimeUnit;
16+
import java.util.concurrent.atomic.AtomicReference;
1517

1618
import jakarta.enterprise.context.ApplicationScoped;
1719

18-
import java.util.concurrent.TimeUnit;
19-
import java.util.concurrent.atomic.AtomicReference;
2020
import org.apache.commons.io.file.PathUtils;
2121
import org.jboss.jandex.AnnotationInstance;
2222
import org.jboss.logging.Logger;
@@ -201,23 +201,25 @@ public void update(String filename, long sizeDownloaded, long totalSize) {
201201
// avoid showing 100% for too long
202202
LOGGER.infof("Verifying and cleaning up\n", progress);
203203
} else {
204-
LOGGER.infof("Progress: %s%%\n", progress);
204+
LOGGER.infof("%s - Progress: %s%%\n", model.name(), progress);
205205
}
206206
}
207207

208208
/**
209209
* @param lastUpdate The last update time in nanoseconds
210210
* Determines whether we should log an update.
211-
* This is done in order to not overwhelm the console with updates which might make
211+
* This is done in order to not overwhelm the console with updates which might
212+
* make
212213
* canceling the download difficult. See
213-
* <a href="https://github.com/quarkiverse/quarkus-langchain4j/issues/1044">this</a>
214+
* <a href=
215+
* "https://github.com/quarkiverse/quarkus-langchain4j/issues/1044">this</a>
214216
*/
215217
private boolean logUpdate(Long lastUpdate) {
216218
if (lastUpdate == null) {
217219
return true;
218220
} else {
219221
return TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
220-
- TimeUnit.NANOSECONDS.toMillis(lastUpdate) > 1_000;
222+
- TimeUnit.NANOSECONDS.toMillis(lastUpdate) > 1_000;
221223
}
222224
}
223225
}));

0 commit comments

Comments
 (0)