nlpcloud 1.0.41 → 1.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nlpcloud.rb +8 -12
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad3fa1f41a3d6dfd09015947748ee6a717b3a192e17adaa4412680e7451bb9c8
4
- data.tar.gz: 2e79604b8072dcdf6d326e7940a71a395ccb652951ca7cd25395a5d76b022d58
3
+ metadata.gz: bb82d8ac819fd557e5bef86758822fac410bdc27fa2e9c0c3c18f42d06353dd1
4
+ data.tar.gz: 56c214eabee690c342c1f122df6a2793e6dc6075b0127d99d1b9c932cb481f36
5
5
  SHA512:
6
- metadata.gz: 4e809b7d56cb1d3c8320dc6e68057ea5e75e0c0edcf0406c2957cd28f629b0df0290b8c3a81a47d9d4aabab83fd85e0714ecaef75d52baf69e9d8824acde768e
7
- data.tar.gz: 593ba9be24ffac31aebe0dc4410b9a9734c7a2590aa29b6704476e23e815715e0e02a99ce92eb462b5f48534060d5b5de5e28d5b2c06487d925bb70f293d8cd9
6
+ metadata.gz: 6dd2821fc24e63fe7d84045fb83c7382924f577a718e3e8693f9bc1273281ff3c2bd90cf92c4353a3f2c00e8271636c4d4c9befd3870f623731a56948dddb92b
7
+ data.tar.gz: b0656713011e671583fde43e702df15d56b322a21202cdd9f514a98c34ccad0b818d4b4524babc4ede43e91855eff23d2ef179be6c181c8832f1374e3feeb845
data/lib/nlpcloud.rb CHANGED
@@ -21,6 +21,9 @@ module NLPCloud
21
21
  if lang == "en"
22
22
  lang = ""
23
23
  end
24
+ if lang == "eng_Latn"
25
+ lang = ""
26
+ end
24
27
 
25
28
  if gpu
26
29
  @root_url += "gpu/"
@@ -114,31 +117,24 @@ module NLPCloud
114
117
  JSON.parse(response.body)
115
118
  end
116
119
 
117
- def generation(text, min_length: nil, max_length: nil, length_no_input: nil,
118
- end_sequence: nil, remove_input: nil, do_sample: nil, num_beams: nil, early_stopping: nil,
119
- no_repeat_ngram_size: nil, num_return_sequences: nil, top_k: nil, top_p: nil,
120
- temperature: nil, repetition_penalty: nil, length_penalty: nil, bad_words: nil, remove_end_sequence: nil,
121
- is_instruct: nil)
120
+ def generation(text, max_length: nil, length_no_input: nil,
121
+ end_sequence: nil, remove_input: nil, num_beams: nil,
122
+ num_return_sequences: nil, top_k: nil, top_p: nil,
123
+ temperature: nil, repetition_penalty: nil, bad_words: nil, remove_end_sequence: nil)
122
124
  payload = {
123
125
  'text' => text,
124
- 'min_length' => min_length,
125
126
  'max_length' => max_length,
126
127
  'length_no_input' => length_no_input,
127
128
  'end_sequence' => end_sequence,
128
129
  'remove_input' => remove_input,
129
- 'do_sample' => do_sample,
130
130
  'num_beams' => num_beams,
131
- 'early_stopping' => early_stopping,
132
- 'no_repeat_ngram_size' => no_repeat_ngram_size,
133
131
  'num_return_sequences' => num_return_sequences,
134
132
  'top_k' => top_k,
135
133
  'top_p' => top_p,
136
134
  'temperature' => temperature,
137
135
  'repetition_penalty' => repetition_penalty,
138
- 'length_penalty' => length_penalty,
139
136
  'bad_words' => bad_words,
140
- 'remove_end_sequence' => remove_end_sequence,
141
- 'is_instruct' => is_instruct
137
+ 'remove_end_sequence' => remove_end_sequence
142
138
  }
143
139
  response = RestClient.post("#{@root_url}/generation", payload.to_json, @headers)
144
140
  JSON.parse(response.body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nlpcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.41
4
+ version: 1.0.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Salinas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-05 00:00:00.000000000 Z
11
+ date: 2023-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client