Skip to content

Commit 4a5a524

Browse files
committed
People search for ollama models using the web ui, this change allows one to copy the url from the browser and for it to be compatible with llama-run. Signed-off-by: Eric Curtin <[email protected]>
1 parent b636228 commit 4a5a524

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/run/run.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,15 @@ class LlamaData {
741741
} else if (string_starts_with(model_, "hf.co/")) {
742742
rm_until_substring(model_, "hf.co/");
743743
ret = huggingface_dl(model_, bn);
744-
} else if (string_starts_with(model_, "https://") || string_starts_with(model_, "http://")) {
744+
} else if ((string_starts_with(model_, "https://") || string_starts_with(model_, "http://")) &&
745+
!string_starts_with(model_, "https://ollama.com/library/")) {
745746
ret = download(model_, bn, true);
746747
} else if (string_starts_with(model_, "github:") || string_starts_with(model_, "github://")) {
747748
rm_until_substring(model_, "github://");
748749
rm_until_substring(model_, "github:");
749750
ret = github_dl(model_, bn);
750751
} else { // ollama:// or nothing
752+
rm_until_substring(model_, "ollama.com/library/");
751753
rm_until_substring(model_, "://");
752754
ret = ollama_dl(model_, bn);
753755
}

0 commit comments

Comments
 (0)