We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7728349 commit 06c4fbaCopy full SHA for 06c4fba
src/huggingface_hub/utils/_http.py
@@ -578,6 +578,8 @@ def _curlify(request: requests.PreparedRequest) -> str:
578
body = request.body
579
if isinstance(body, bytes):
580
body = body.decode("utf-8", errors="ignore")
581
+ elif hasattr(body, "read"):
582
+ body = "<file-like object>" # Don't try to read it to avoid consuming the stream
583
if len(body) > 1000:
584
body = body[:1000] + " ... [truncated]"
585
parts += [("-d", body.replace("\n", ""))]
0 commit comments