Skip to content

Commit f828839

Browse files
zekemattt
andauthored
add descriptions to methods in README (#143)
* add descriptions to methods in README * Update README.md Co-authored-by: Mattt <[email protected]> * Update README.md Co-authored-by: Mattt <[email protected]> --------- Co-authored-by: Mattt <[email protected]>
1 parent 502b22d commit f828839

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ console.log(prediction.output);
6767
// ['https://replicate.delivery/pbxt/RoaxeXqhL0xaYyLm6w3bpGwF5RaNBjADukfFnMbhOyeoWBdhA/out-0.png']
6868
```
6969

70-
To run a model that takes a file input,
71-
convert its data into a base64-encoded data URI:
70+
To run a model that takes a file input, pass a URL to a publicly accessible file. Or, for smaller files (<10MB), you can convert file data into a base64-encoded data URI and pass that directly:
71+
7272

7373
```js
7474
import { promises as fs } from "fs";
@@ -174,6 +174,8 @@ const output = await replicate.run(model, { input });
174174

175175
### `replicate.models.get`
176176

177+
Get metadata for a public model or a private model that you own.
178+
177179
```js
178180
const response = await replicate.models.get(model_owner, model_name);
179181
```
@@ -201,6 +203,8 @@ const response = await replicate.models.get(model_owner, model_name);
201203

202204
### `replicate.models.versions.list`
203205

206+
Get a list of all published versions of a model, including input and output schemas for each version.
207+
204208
```js
205209
const response = await replicate.models.versions.list(model_owner, model_name);
206210
```
@@ -237,6 +241,8 @@ const response = await replicate.models.versions.list(model_owner, model_name);
237241

238242
### `replicate.models.versions.get`
239243

244+
Get metatadata for a specific version of a model.
245+
240246
```js
241247
const response = await replicate.models.versions.get(model_owner, model_name, version_id);
242248
```
@@ -260,6 +266,8 @@ const response = await replicate.models.versions.get(model_owner, model_name, ve
260266

261267
### `replicate.collections.get`
262268

269+
Get a list of curated model collections. See [replicate.com/collections](https://replicate.com/collections).
270+
263271
```js
264272
const response = await replicate.collections.get(collection_slug);
265273
```
@@ -270,6 +278,8 @@ const response = await replicate.collections.get(collection_slug);
270278

271279
### `replicate.predictions.create`
272280

281+
Run a model with inputs you provide.
282+
273283
```js
274284
const response = await replicate.predictions.create(options);
275285
```
@@ -380,6 +390,8 @@ const response = await replicate.predictions.get(prediction_id);
380390

381391
### `replicate.predictions.cancel`
382392

393+
Stop a running prediction before it finishes.
394+
383395
```js
384396
const response = await replicate.predictions.cancel(prediction_id);
385397
```
@@ -412,6 +424,8 @@ const response = await replicate.predictions.cancel(prediction_id);
412424

413425
### `replicate.predictions.list`
414426

427+
Get a paginated list of all the predictions you've created.
428+
415429
```js
416430
const response = await replicate.predictions.list();
417431
```
@@ -443,7 +457,7 @@ const response = await replicate.predictions.list();
443457

444458
### `replicate.trainings.create`
445459

446-
Use the training API to fine-tune language models
460+
Use the [training API](https://replicate.com/docs/fine-tuning) to fine-tune language models
447461
to make them better at a particular task.
448462
To see what **language models** currently support fine-tuning,
449463
check out Replicate's [collection of trainable language models](https://replicate.com/collections/trainable-language-models).
@@ -488,6 +502,8 @@ const response = await replicate.trainings.create(model_owner, model_name, versi
488502
489503
### `replicate.trainings.get`
490504

505+
Get metadata and status of a training.
506+
491507
```js
492508
const response = await replicate.trainings.get(training_id);
493509
```
@@ -519,6 +535,8 @@ const response = await replicate.trainings.get(training_id);
519535

520536
### `replicate.trainings.cancel`
521537

538+
Stop a running training job before it finishes.
539+
522540
```js
523541
const response = await replicate.trainings.cancel(training_id);
524542
```
@@ -550,6 +568,8 @@ const response = await replicate.trainings.cancel(training_id);
550568

551569
### `replicate.trainings.list`
552570

571+
Get a paginated list of all the trainings you've run.
572+
553573
```js
554574
const response = await replicate.trainings.list();
555575
```
@@ -581,6 +601,10 @@ const response = await replicate.trainings.list();
581601

582602
### `replicate.deployments.predictions.create`
583603

604+
Run a model using your own custom deployment.
605+
606+
Deployments allow you to run a model with a private, fixed API endpoint. You can configure the version of the model, the hardware it runs on, and how it scales. See the [deployments guide](https://replicate.com/docs/deployments) to learn more and get started.
607+
584608
```js
585609
const response = await replicate.deployments.predictions.create(deployment_owner, deployment_name, options);
586610
```
@@ -620,6 +644,8 @@ const page2 = await paginator.next();
620644

621645
### `replicate.request`
622646

647+
Low-level method used by the Replicate client to interact with API endpoints.
648+
623649
```js
624650
const response = await replicate.request(route, parameters);
625651
```

0 commit comments

Comments
 (0)