@@ -248,17 +248,17 @@ const response = await replicate.predictions.create(options);
248
248
" get" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq" ,
249
249
" cancel" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq/cancel"
250
250
},
251
- " created_at" : " 2022-04-26T22:13:06.224088Z" ,
252
- " started_at" : null ,
253
- " completed_at" : null ,
254
251
" status" : " succeeded" ,
255
252
" input" : {
256
253
" text" : " Alice"
257
254
},
258
255
" output" : null ,
259
256
" error" : null ,
260
257
" logs" : null ,
261
- " metrics" : {}
258
+ " metrics" : {},
259
+ " created_at" : " 2022-04-26T22:13:06.224088Z" ,
260
+ " started_at" : null ,
261
+ " completed_at" : null
262
262
}
263
263
```
264
264
@@ -280,17 +280,49 @@ const response = await replicate.predictions.get(prediction_id);
280
280
" get" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq" ,
281
281
" cancel" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq/cancel"
282
282
},
283
+ " status" : " starting" ,
284
+ " input" : {
285
+ " text" : " Alice"
286
+ },
287
+ " output" : null ,
288
+ " error" : null ,
289
+ " logs" : null ,
290
+ " metrics" : {},
283
291
" created_at" : " 2022-04-26T22:13:06.224088Z" ,
284
292
" started_at" : null ,
285
- " completed_at" : null ,
286
- " status" : " starting" ,
293
+ " completed_at" : null
294
+ }
295
+ ```
296
+
297
+ ### ` replicate.predictions.cancel `
298
+
299
+ ``` js
300
+ const response = await replicate .predictions .cancel (prediction_id);
301
+ ```
302
+
303
+ | name | type | description |
304
+ | --------------- | ------ | ------------------------------- |
305
+ | ` prediction_id ` | number | ** Required** . The prediction id |
306
+
307
+ ``` jsonc
308
+ {
309
+ " id" : " ufawqhfynnddngldkgtslldrkq" ,
310
+ " version" : " 5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa" ,
311
+ " urls" : {
312
+ " get" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq" ,
313
+ " cancel" : " https://api.replicate.com/v1/predictions/ufawqhfynnddngldkgtslldrkq/cancel"
314
+ },
315
+ " status" : " canceled" ,
287
316
" input" : {
288
317
" text" : " Alice"
289
318
},
290
319
" output" : null ,
291
320
" error" : null ,
292
321
" logs" : null ,
293
- " metrics" : {}
322
+ " metrics" : {},
323
+ " created_at" : " 2022-04-26T22:13:06.224088Z" ,
324
+ " started_at" : " 2022-04-26T22:13:06.224088Z" ,
325
+ " completed_at" : " 2022-04-26T22:13:06.224088Z"
294
326
}
295
327
```
296
328
@@ -314,11 +346,11 @@ const response = await replicate.predictions.list();
314
346
" get" : " https://api.replicate.com/v1/predictions/jpzd7hm5gfcapbfyt4mqytarku" ,
315
347
" cancel" : " https://api.replicate.com/v1/predictions/jpzd7hm5gfcapbfyt4mqytarku/cancel"
316
348
},
349
+ " source" : " web" ,
350
+ " status" : " succeeded" ,
317
351
" created_at" : " 2022-04-26T20:00:40.658234Z" ,
318
352
" started_at" : " 2022-04-26T20:00:84.583803Z" ,
319
- " completed_at" : " 2022-04-26T20:02:27.648305Z" ,
320
- " source" : " web" ,
321
- " status" : " succeeded"
353
+ " completed_at" : " 2022-04-26T20:02:27.648305Z"
322
354
}
323
355
/* ... */
324
356
]
@@ -328,12 +360,14 @@ const response = await replicate.predictions.list();
328
360
### ` replicate.trainings.create `
329
361
330
362
``` js
331
- const response = await replicate .trainings .create (options);
363
+ const response = await replicate .trainings .create (model_owner, model_name, version_id, options);
332
364
```
333
365
334
366
| name | type | description |
335
367
| ------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
336
- | ` options.version ` | string | ** Required** . The model version |
368
+ | ` model_owner ` | string | ** Required** . The name of the user or organization that owns the model. |
369
+ | ` model_name ` | string | ** Required** . The name of the model. |
370
+ | ` version ` | string | ** Required** . The model version |
337
371
| ` options.destination ` | string | ** Required** . The destination for the trained version in the form ` {username}/{model_name} ` |
338
372
| ` options.input ` | object | ** Required** . An object with the model's inputs |
339
373
| ` options.webhook ` | string | An HTTPS URL for receiving a webhook when the training has new output |
@@ -342,7 +376,7 @@ const response = await replicate.trainings.create(options);
342
376
``` jsonc
343
377
{
344
378
" id" : " zz4ibbonubfz7carwiefibzgga" ,
345
- " version" : " {version} " ,
379
+ " version" : " 3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523 " ,
346
380
" status" : " starting" ,
347
381
" input" : {
348
382
" text" : " ..."
@@ -369,7 +403,7 @@ const response = await replicate.trainings.get(training_id);
369
403
``` jsonc
370
404
{
371
405
" id" : " zz4ibbonubfz7carwiefibzgga" ,
372
- " version" : " {version} " ,
406
+ " version" : " 3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523 " ,
373
407
" status" : " succeeded" ,
374
408
" input" : {
375
409
" data" : " ..."
@@ -381,9 +415,40 @@ const response = await replicate.trainings.get(training_id);
381
415
" error" : null ,
382
416
" logs" : null ,
383
417
" webhook_completed" : null ,
384
- " started_at" : null ,
418
+ " started_at" : " 2023-03-28T21:48:02.402755Z " ,
385
419
" created_at" : " 2023-03-28T21:47:58.566434Z" ,
386
- " completed_at" : null
420
+ " completed_at" : " 2023-03-28T02:49:48.492023Z"
421
+ }
422
+ ```
423
+
424
+ ### ` replicate.trainings.cancel `
425
+
426
+ ``` js
427
+ const response = await replicate .trainings .cancel (training_id);
428
+ ```
429
+
430
+ | name | type | description |
431
+ | ------------- | ------ | ----------------------------- |
432
+ | ` training_id ` | number | ** Required** . The training id |
433
+
434
+ ``` jsonc
435
+ {
436
+ " id" : " zz4ibbonubfz7carwiefibzgga" ,
437
+ " version" : " 3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523" ,
438
+ " status" : " canceled" ,
439
+ " input" : {
440
+ " data" : " ..."
441
+ " param1" : " ..."
442
+ },
443
+ " output" : {
444
+ " version" : " ..."
445
+ },
446
+ " error" : null ,
447
+ " logs" : null ,
448
+ " webhook_completed" : null ,
449
+ " started_at" : " 2023-03-28T21:48:02.402755Z" ,
450
+ " created_at" : " 2023-03-28T21:47:58.566434Z" ,
451
+ " completed_at" : " 2023-03-28T02:49:48.492023Z"
387
452
}
388
453
```
389
454
@@ -407,11 +472,11 @@ const response = await replicate.trainings.list();
407
472
" get" : " https://api.replicate.com/v1/trainings/jpzd7hm5gfcapbfyt4mqytarku" ,
408
473
" cancel" : " https://api.replicate.com/v1/trainings/jpzd7hm5gfcapbfyt4mqytarku/cancel"
409
474
},
475
+ " source" : " web" ,
476
+ " status" : " succeeded" ,
410
477
" created_at" : " 2022-04-26T20:00:40.658234Z" ,
411
478
" started_at" : " 2022-04-26T20:00:84.583803Z" ,
412
- " completed_at" : " 2022-04-26T20:02:27.648305Z" ,
413
- " source" : " web" ,
414
- " status" : " succeeded"
479
+ " completed_at" : " 2022-04-26T20:02:27.648305Z"
415
480
}
416
481
/* ... */
417
482
]
0 commit comments