MCPcopy
hub / github.com/huggingface/smolagents / test_load_model_hf_api_model

Function test_load_model_hf_api_model

tests/test_cli.py:48–54  ·  view source on GitHub ↗
(set_env_vars)

Source from the content-addressed store, hash-verified

46
47
48def test_load_model_hf_api_model(set_env_vars):
49 with patch("huggingface_hub.InferenceClient") as huggingface_hub_InferenceClient:
50 model = load_model("InferenceClientModel", "test_model_id")
51 assert isinstance(model, InferenceClientModel)
52 assert model.model_id == "test_model_id"
53 assert huggingface_hub_InferenceClient.call_count == 1
54 assert huggingface_hub_InferenceClient.call_args.kwargs["token"] == "test_hf_api_key"
55
56
57def test_load_model_invalid_model_type():

Callers

nothing calls this directly

Calls 1

load_modelFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…