From fc4bab1a71752ed9ed98495f495d5df0e6ae9023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Wed, 12 Nov 2025 12:00:54 -0600 Subject: [PATCH] Fix ollama example --- .../example/ollamahf/OllamaHuggingFaceContainer.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java index 55fd110fa13..58267134a5f 100644 --- a/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java +++ b/examples/ollama-hugging-face/src/test/java/com/example/ollamahf/OllamaHuggingFaceContainer.java @@ -28,14 +28,7 @@ protected void containerIsStarted(InspectContainerResponse containerInfo, boolea executeCommand("apt-get", "upgrade", "-y"); executeCommand("apt-get", "install", "-y", "python3-pip"); executeCommand("pip", "install", "huggingface-hub"); - executeCommand( - "huggingface-cli", - "download", - huggingFaceModel.repository, - huggingFaceModel.model, - "--local-dir", - "." - ); + executeCommand("hf", "download", huggingFaceModel.repository, huggingFaceModel.model, "--local-dir", "."); executeCommand("sh", "-c", String.format("echo '%s' > Modelfile", huggingFaceModel.modelfileContent)); executeCommand("ollama", "create", huggingFaceModel.model, "-f", "Modelfile"); executeCommand("rm", huggingFaceModel.model); @@ -48,7 +41,7 @@ private void executeCommand(String... command) throws ContainerLaunchException, ExecResult execResult = execInContainer(command); if (execResult.getExitCode() > 0) { throw new ContainerLaunchException( - "Failed to execute " + String.join(" ", command) + ": " + execResult.getStderr() + "Failed to execute " + String.join(" ", command) + ": " + execResult.getStdout() ); } }