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 c6f1222 commit 822e831Copy full SHA for 822e831
UPGRADING.md
@@ -476,7 +476,14 @@ url = file.urls["get"]
476
### After (v2)
477
478
```python
479
-# Upload file (takes bytes, not file handle)
+# Upload file (supports file handle, bytes, or PathLike)
480
+with open("image.jpg", "rb") as f:
481
+ file = replicate.files.create(
482
+ content=f, # Can pass file handle directly
483
+ filename="image.jpg"
484
+ )
485
+
486
+# Or read into memory if needed
487
with open("image.jpg", "rb") as f:
488
file = replicate.files.create(
489
content=f.read(),
0 commit comments