Skip to content

Commit e20a42e

Browse files
committed
fix as comments
1 parent e102d68 commit e20a42e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

common/common.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,14 @@ struct common_init_result common_init_from_params(common_params & params) {
10281028
}
10291029

10301030
std::string get_model_endpoint() {
1031-
std::string model_endpoint = "https://huggingface.co/";
1031+
//For other communities with the same model backend protocols
10321032
const char * model_endpoint_env = getenv("MODEL_ENDPOINT");
1033-
if (model_endpoint_env) {
1034-
model_endpoint = model_endpoint_env;
1033+
//For HF or HF mirror endpoints
1034+
const char * hf_endpoint_env = getenv("HF_ENDPOINT");
1035+
const char * endpoint_env = model_endpoint_env ? model_endpoint_env : hf_endpoint_env;
1036+
std::string model_endpoint = "https://huggingface.co/";
1037+
if (endpoint_env) {
1038+
model_endpoint = endpoint_env;
10351039
if (model_endpoint.back() != '/') model_endpoint += '/';
10361040
}
10371041
return model_endpoint;

0 commit comments

Comments
 (0)