File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -640,7 +640,17 @@ class LlamaData {
640640 return 1 ;
641641 }
642642
643- model_ = model_.substr (pos + 3 ); // Skip past "://"
643+ model_ = model_.substr (pos + sizeof (" ://" ) - 1 ); // Skip past "://"
644+ return 0 ;
645+ }
646+
647+ int remove_hf_co (std::string & model_) {
648+ const std::string::size_type pos = model_.find (" hf.co/" );
649+ if (pos == std::string::npos) {
650+ return 1 ;
651+ }
652+
653+ model_ = model_.substr (pos + sizeof (" hf.co/" ) - 1 ); // Skip past "hf.co/"
644654 return 0 ;
645655 }
646656
@@ -658,6 +668,9 @@ class LlamaData {
658668 if (string_starts_with (model_, " hf://" ) || string_starts_with (model_, " huggingface://" )) {
659669 remove_proto (model_);
660670 ret = huggingface_dl (model_, headers, bn);
671+ } else if (string_starts_with (model_, " hf.co/" )) {
672+ remove_hf_co (model_);
673+ huggingface_dl (model_, headers, bn);
661674 } else if (string_starts_with (model_, " ollama://" )) {
662675 remove_proto (model_);
663676 ret = ollama_dl (model_, headers, bn);
You can’t perform that action at this time.
0 commit comments