File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1028,10 +1028,14 @@ struct common_init_result common_init_from_params(common_params & params) {
10281028}
10291029
10301030std::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;
You can’t perform that action at this time.
0 commit comments