Skip to content

Commit

Permalink
Update recommendations for passing file inputs to models
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Jun 28, 2024
1 parent def0e2d commit 3d2f3f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ if let latestVersion = model.latestVersion {
Some models,
like [tencentarc/gfpgan](https://replicate.com/tencentarc/gfpgan),
receive images as inputs.
To pass a file as an input,
read the contents of the file into a `Data` object,
and use the `uriEncoded(mimeType:) helper method to create a URI-encoded string.
To run a model that takes a file input you can pass either
a URL to a publicly accessible file on the Internet
or use the `uriEncoded(mimeType:) helper method to create
a base64-encoded data URL from the contents of a local file.

```swift
let model = try await replicate.getModel("tencentarc/gfpgan")
Expand Down

0 comments on commit 3d2f3f3

Please sign in to comment.