{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigq7cboechktci2bpwpfrcfvw4cdhvwx65xf367u7gsuxb7mwbw6m",
    "uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mnhdkjoo7az2"
  },
  "path": "/t/help-please-hypererrorlegacy/176481#post_5",
  "publishedAt": "2026-06-04T08:20:26.000Z",
  "site": "https://discuss.huggingface.co",
  "tags": [
    "InferenceClient reference",
    "Feature Extraction task docs",
    "HF Inference provider docs",
    "HF_DEBUG, HF_INFERENCE_ENDPOINT, and other huggingface_hub env vars",
    "huggingface_hub v1 migration notes: requests → httpx"
  ],
  "textContent": "Thank you! But, hmm, I tried a few things from a Colab Free environment, but I still cannot reproduce this…\n\n* * *\n\nI tested the reported `InferenceClient.feature_extraction(...)` path from Google Colab Free.\n\n\n    Platform: Linux-6.6.122+-x86_64-with-glibc2.35\n    Python:   3.12.13\n\n\nResults:\n\n`huggingface_hub` | Token | Result\n---|---|---\n`1.17.0` | yes | OK\n`1.17.0` | no | normal `401 Unauthorized`\n`0.36.2` | yes | OK\n`0.36.2` | no | normal `401 Unauthorized`\n\nWith `HF_DEBUG=1`, the default call:\n\n\n    from huggingface_hub import InferenceClient\n\n    client = InferenceClient()\n    client.feature_extraction(\"Hi, who are you?\")\n\n\nresolved to the expected router path:\n\n\n    GET  https://huggingface.co/api/tasks\n    GET  https://huggingface.co/api/models/facebook/bart-base\n    POST https://router.huggingface.co/hf-inference/models/facebook/bart-base/pipeline/feature-extraction\n\n\nWith a token, this worked and returned an ndarray of shape:\n\n\n    (8, 768)\n\n\nWithout a token, the same router URL returned a normal:\n\n\n    401 Unauthorized\n\n\nSo I cannot reproduce:\n\n\n    HyperErrorLegacy(hyper_util::client::legacy::Error(\n        Connect,\n        ConnectError(\"invalid URL, scheme is not http\")\n    ))\n\n\nfrom Colab.\n\nI also tested explicit models:\n\nModel | Provider | Result\n---|---|---\n`sentence-transformers/all-MiniLM-L6-v2` | `hf-inference` | OK, shape `(384,)`\n`ibm-granite/granite-embedding-97m-multilingual-r2` | `hf-inference` | OK, shape `(384,)`\n`thenlper/gte-large` | `hf-inference` | local `ValueError`; task metadata says `sentence-similarity`, not `feature-extraction`\n\nThe `thenlper/gte-large` result seems unrelated to `HyperErrorLegacy`; it fails before the router POST.\n\nRelevant docs:\n\n  * InferenceClient reference\n  * Feature Extraction task docs\n  * HF Inference provider docs\n  * HF_DEBUG, HF_INFERENCE_ENDPOINT, and other huggingface_hub env vars\n  * huggingface_hub v1 migration notes: requests → httpx\n\n\n\nMy current guess is that this was either transient, environment-specific, proxy/gateway-specific, region/backend-shard-specific, or related to an endpoint override such as `HF_INFERENCE_ENDPOINT` / `HF_ENDPOINT`.\n\nCould the reporter share:\n\n\n    import os\n    import sys\n    import huggingface_hub\n\n    try:\n        import requests\n    except Exception:\n        requests = None\n\n    try:\n        import httpx\n    except Exception:\n        httpx = None\n\n    print(\"python:\", sys.version)\n    print(\"huggingface_hub:\", huggingface_hub.__version__)\n    print(\"requests:\", getattr(requests, \"__version__\", None))\n    print(\"httpx:\", getattr(httpx, \"__version__\", None))\n    print(\"HF_TOKEN_present:\", bool(os.environ.get(\"HF_TOKEN\")))\n    print(\"HF_ENDPOINT:\", os.environ.get(\"HF_ENDPOINT\"))\n    print(\"HF_INFERENCE_ENDPOINT:\", os.environ.get(\"HF_INFERENCE_ENDPOINT\"))\n    print(\"HF_HUB_DISABLE_IMPLICIT_TOKEN:\", os.environ.get(\"HF_HUB_DISABLE_IMPLICIT_TOKEN\"))\n    print(\"HTTP_PROXY:\", bool(os.environ.get(\"HTTP_PROXY\")))\n    print(\"HTTPS_PROXY:\", bool(os.environ.get(\"HTTPS_PROXY\")))\n    print(\"ALL_PROXY:\", bool(os.environ.get(\"ALL_PROXY\")))\n\n\nand, if possible, rerun with:\n\n\n    HF_DEBUG=1 python repro.py\n\n\nPlease redact any token before posting. The most useful detail would be the `HF_DEBUG=1` output showing the exact URL being called.",
  "title": "Help please.. HyperErrorLegacy"
}