Skip to content

Commit 4a41761

Browse files
davanstrienclaude
authored andcommitted
Fix set_space_volumes sending wrong JSON structure (#4054)
The PUT /api/spaces/{repo_id}/volumes endpoint expects a JSON object with a "volumes" key, but the client was sending a bare JSON array. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b768bb2 commit 4a41761

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/huggingface_hub/hf_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8204,7 +8204,7 @@ def set_space_volumes(
82048204
... )
82058205
```
82068206
"""
8207-
payload = [vol.to_dict() for vol in volumes]
8207+
payload = {"volumes": [vol.to_dict() for vol in volumes]}
82088208
r = get_session().put(
82098209
f"{self.endpoint}/api/spaces/{repo_id}/volumes",
82108210
headers=self._build_hf_headers(token=token),

0 commit comments

Comments
 (0)