| 1384 | common_init_result::~common_init_result() = default; |
| 1385 | |
| 1386 | std::string common_get_model_endpoint() { |
| 1387 | const char * model_endpoint_env = getenv("MODEL_ENDPOINT"); |
| 1388 | // We still respect the use of environment-variable "HF_ENDPOINT" for backward-compatibility. |
| 1389 | const char * hf_endpoint_env = getenv("HF_ENDPOINT"); |
| 1390 | const char * endpoint_env = model_endpoint_env ? model_endpoint_env : hf_endpoint_env; |
| 1391 | std::string model_endpoint = "https://huggingface.co/"; |
| 1392 | if (endpoint_env) { |
| 1393 | model_endpoint = endpoint_env; |
| 1394 | if (model_endpoint.back() != '/') { |
| 1395 | model_endpoint += '/'; |
| 1396 | } |
| 1397 | } |
| 1398 | return model_endpoint; |
| 1399 | } |
| 1400 | |
| 1401 | common_context_seq_rm_type common_context_can_seq_rm(llama_context * ctx) { |
| 1402 | auto * mem = llama_get_memory(ctx); |
no outgoing calls
no test coverage detected