replicate-api 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a977c31bb41a70a5734b042c1a3147d10b5d53976a0c6ad5f8425da6fabe74b
4
- data.tar.gz: ea9f526e0b3afd6f221edb0a937aca33a8ad21fd7cb2be1c640659764789ee10
3
+ metadata.gz: bdc195548bd20d60b90ad926efc9a045dabf09f932b9a5a41ee693b394cce59c
4
+ data.tar.gz: 1058816a27e6fcdbe4853df7d2bb4c102ddaee92933e6b00309dbcd4b8a463d2
5
5
  SHA512:
6
- metadata.gz: 5389b2593291fd89e28a5f6e6beb9fbf877c03f2cdc3fd2e28972615c03c5222e778b97d51c81a63ce8628aefaab966b95df86460dd88251316483a1ff93899c
7
- data.tar.gz: cf6c9e95bcc21b96f2676f9a8707a9823240fbafefab1f01ba9b5602833246882c2b1b8c5488b76a13adc81fbe188b7a1d0ef12a919829876d0328170ebfbec5
6
+ metadata.gz: e35c8e77c74981fb177a8b325ba36658eee0195163166773697fb1d3c6133ccac29af72f14b1891575687d6a1c5040a98ee0e2e8f8a1027cdf5843bdb67757ab
7
+ data.tar.gz: 0f04b274aee7be57ab8f266cb87c5daacf83ef8581310afca9d4b416d1077e138d2766b9b57cf267f3a72058ad058e36c225f0ddfddf06379a5ec48b33593998
data/Gemfile CHANGED
@@ -9,5 +9,3 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- gem 'pry', '~> 0.13.1'
13
-
data/Gemfile.lock CHANGED
@@ -7,16 +7,11 @@ PATH
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- coderay (1.1.3)
11
10
  diff-lcs (1.5.0)
12
11
  faraday (2.7.1)
13
12
  faraday-net_http (>= 2.0, < 3.1)
14
13
  ruby2_keywords (>= 0.0.4)
15
14
  faraday-net_http (3.0.2)
16
- method_source (1.0.0)
17
- pry (0.13.1)
18
- coderay (~> 1.1)
19
- method_source (~> 1.0)
20
15
  rake (13.0.6)
21
16
  rspec (3.12.0)
22
17
  rspec-core (~> 3.12.0)
@@ -37,7 +32,6 @@ PLATFORMS
37
32
  arm64-darwin-21
38
33
 
39
34
  DEPENDENCIES
40
- pry (~> 0.13.1)
41
35
  rake (~> 13.0)
42
36
  replicate-api!
43
37
  rspec (~> 3.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
 
25
25
  You can run a model and get its output:
26
26
 
27
- ```
27
+ ```ruby
28
28
  replicate = Replicate::Client.new(api_key: "#{YOUR API KEY HERE}")
29
29
  model = replicate.models("stability-ai/stable-diffusion")
30
30
  model.predict(prompt="a 19th century portrait of a wombat gentleman")
@@ -1,6 +1,4 @@
1
1
  require 'faraday'
2
- require 'pry'
3
-
4
2
 
5
3
  module Replicate
6
4
  REPLICATE_API_BASE_URL = "https://api.replicate.com/v1"
@@ -9,8 +9,8 @@ module Replicate
9
9
  @version_id = response.body["latest_version"]["id"]
10
10
  end
11
11
 
12
- def predict(prompt:)
13
- body = {version: @version_id, input: {prompt: prompt}}
12
+ def predict(prompt:, height = 512, width = 512)
13
+ body = {version: @version_id, input: {prompt: prompt, height: height, width: width}}
14
14
  response = @client.requests(method: "POST", path: "predictions", **body)
15
15
  poll(prediction_id: response.body["id"])
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Replicate
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: replicate-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivia Li
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-27 00:00:00.000000000 Z
11
+ date: 2022-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -31,7 +31,6 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - ".gem/credentials"
35
34
  - ".rspec"
36
35
  - Gemfile
37
36
  - Gemfile.lock
data/.gem/credentials DELETED
@@ -1 +0,0 @@
1
- :github: Bearer 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