From 4421aa1d22c47245b2305d809f8a72b38dd3a22a Mon Sep 17 00:00:00 2001 From: Mattt Date: Fri, 15 Dec 2023 05:13:49 -0800 Subject: [PATCH] Update README.md --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 61d6f988..3f6babaf 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,7 @@ import Replicate let replicate = Replicate.Client(token: <#token#>) ``` -> **Warning** -> +> [!WARNING] > Don't store secrets in code or any other resources bundled with your app. > Instead, fetch them from CloudKit or another server and store them in the keychain. @@ -43,9 +42,7 @@ Or fetch a model by name and create a prediction against its latest version: ```swift let model = try await replicate.getModel("stability-ai/stable-diffusion") if let latestVersion = model.latestVersion { - let prompt = """ - a 19th century portrait of a wombat gentleman - """ + let prompt = "a 19th century portrait of a wombat gentleman" let prediction = try await replicate.createPrediction(version: latestVersion.id, input: ["prompt": "\(prompt)"], wait: true) @@ -78,9 +75,7 @@ You can start a model and run it in the background: ```swift let model = replicate.getModel("kvfrans/clipdraw") -let prompt = """ - Watercolor painting of an underwater submarine -""" +let prompt = "watercolor painting of an underwater submarine" var prediction = replicate.createPrediction(version: model.latestVersion!.id, input: ["prompt": "\(prompt)"]) print(prediction.status) @@ -96,9 +91,7 @@ You can cancel a running prediction: ```swift let model = replicate.getModel("kvfrans/clipdraw") -let prompt = """ - Watercolor painting of an underwater submarine -""" +let prompt = "watercolor painting of an underwater submarine" var prediction = replicate.createPrediction(version: model.latestVersion!.id, input: ["prompt": "\(prompt)"]) print(prediction.status)