You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/Users/jd/code/prompt-js/prompt-worker-py/activities/llama_guard.py", line 98, in check_endpoint
x = list_inference_endpoints(namespace=NAMESPACE, token=HF_API_KEY)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/hf_api.py", line 7716, in list_inference_endpoints
return [
^
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/hf_api.py", line 7717, in<listcomp>
InferenceEndpoint.from_raw(endpoint, namespace=namespace, token=token)
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/_inference_endpoints.py", line 134, in from_raw
return cls(raw=raw, namespace=namespace, _token=token, _api=api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 7, in __init__
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/_inference_endpoints.py", line 138, in __post_init__
self._populate_from_raw()
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/_inference_endpoints.py", line 394, in _populate_from_raw
self.created_at = parse_datetime(self.raw["status"]["createdAt"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jd/code/prompt-js/prompt-worker-py/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_datetime.py", line 59, in parse_datetime
raise ValueError(
ValueError: Cannot parse '2024-11-20T20:01:58Z' as a datetime. Date string is expected to follow '%Y-%m-%dT%H:%M:%S.%fZ' pattern.
Hi @james-deee, This isn't a bug in huggingface_hub.list_inference_endpoints. The API returns timestamps without milliseconds when they're zero, causing a parsing error in huggingface_hub.list_inference_endpoints that expects timestamps with milliseconds. This issue should be fixed on the API side — pinging @ErikKaum for more info.
Describe the bug
Pretty simple, the
list_inference_endpoints
is completely broken. It fails with some parse date error, see stacktrace.Reproduction
list_inference_endpoints(namespace=NAMESPACE, token=HF_API_KEY)
Logs
System info
The text was updated successfully, but these errors were encountered: