replicate-ruby 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -12
- data/lib/replicate/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7164e7c8619b9fdec6fcf60570f446f3ae5ff2e7a39fb16470c26bafd6c9ea
|
4
|
+
data.tar.gz: 9d663f572a93669ed264664906437eaab2c8e161c1f202a4bae587702f44b353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c586d38a71f7698d2107ceb946f3804bf9e0e423fe627f4da3bc95881e6692ae017a9fef058da38976b7cbf0923c0d74a8dedf2e7f68f0245ae2b01bc534eb96
|
7
|
+
data.tar.gz: 8da7f8bc45c03e44ee207d440c3a2d4a5b1218b4d91c88471a33964b88a643948e7d1ecb48b5461d900ef39817e816ac0fa561c77d195d5667892bf264c95d8d
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Replicate Ruby client
|
2
2
|
|
3
|
-
This is a Ruby client for Replicate. It lets you run models from your Ruby code and do various other things on Replicate.
|
3
|
+
This is a Ruby client for [Replicate](https://replicate.com/). It lets you run models from your Ruby code and do various other things on Replicate.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -28,7 +28,7 @@ model = Replicate.client.retrieve_model("stability-ai/stable-diffusion")
|
|
28
28
|
version = model.latest_version
|
29
29
|
|
30
30
|
# List of versions
|
31
|
-
version = Replicate.client.retrieve_model("stability-ai/stable-diffusion", version: all)
|
31
|
+
version = Replicate.client.retrieve_model("stability-ai/stable-diffusion", version: :all)
|
32
32
|
|
33
33
|
# Specific version
|
34
34
|
version = Replicate.client.retrieve_model("stability-ai/stable-diffusion", version: "<id>")
|
@@ -39,10 +39,7 @@ And then run predictions on it:
|
|
39
39
|
```ruby
|
40
40
|
prediction = version.predict(prompt: "a handsome teddy bear")
|
41
41
|
|
42
|
-
#
|
43
|
-
prediction = version.predict(prompt: "a handsome teddy bear", "https://webhook.url/path")
|
44
|
-
|
45
|
-
# Or manually refetch predictions
|
42
|
+
# manually refetch the prediction status
|
46
43
|
prediction = prediction.refetch
|
47
44
|
|
48
45
|
# or cancel a running prediction
|
@@ -50,14 +47,13 @@ prediction = prediction.cancel
|
|
50
47
|
|
51
48
|
# and if a prediction returns with status succeeded, you can retrieve the output
|
52
49
|
output = prediction.output
|
50
|
+
|
51
|
+
# Optionally you can submit a webhook url for replicate to send a POST request once a prediction has completed
|
52
|
+
prediction = version.predict(prompt: "a handsome teddy bear", "https://webhook.url/path") # call predict
|
53
|
+
id = prediction.id # store prediction id in your backend
|
54
|
+
prediction = Replicate.client.retrieve_prediction(id) # retrieve prediction during webhook with id from backend
|
53
55
|
```
|
54
56
|
|
55
57
|
## Development
|
56
58
|
|
57
59
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
58
|
-
|
59
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
60
|
-
|
61
|
-
## Contributing
|
62
|
-
|
63
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/YOUR_GITHUB_USERNAME/replicate-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/YOUR_GITHUB_USERNAME/replicate-ruby/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/replicate/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replicate-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Dreaming Tulpa
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2022-10-13 00:00:00.000000000 Z
|
@@ -80,9 +80,9 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email:
|
85
|
-
-
|
85
|
+
- hey@dreamingtulpa.com
|
86
86
|
executables: []
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
@@ -105,13 +105,13 @@ files:
|
|
105
105
|
- lib/replicate/record/prediction.rb
|
106
106
|
- lib/replicate/version.rb
|
107
107
|
- sig/replicate/ruby.rbs
|
108
|
-
homepage: https://github.com/
|
108
|
+
homepage: https://github.com/dreamingtulpa/replicate-ruby
|
109
109
|
licenses: []
|
110
110
|
metadata:
|
111
|
-
homepage_uri: https://github.com/
|
112
|
-
source_code_uri: https://github.com/
|
113
|
-
changelog_uri: https://github.com/
|
114
|
-
post_install_message:
|
111
|
+
homepage_uri: https://github.com/dreamingtulpa/replicate-ruby
|
112
|
+
source_code_uri: https://github.com/dreamingtulpa/replicate-ruby
|
113
|
+
changelog_uri: https://github.com/dreamingtulpa/replicate-ruby/blob/master/CHANGELOG.md
|
114
|
+
post_install_message:
|
115
115
|
rdoc_options: []
|
116
116
|
require_paths:
|
117
117
|
- lib
|
@@ -126,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.3.
|
130
|
-
signing_key:
|
129
|
+
rubygems_version: 3.0.3.1
|
130
|
+
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Ruby client for Replicate
|
133
133
|
test_files: []
|