nlpcloud 1.0.42 → 1.0.44
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 +4 -4
- data/lib/nlpcloud.rb +9 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20eafde6f6320baa0fcf7a2842a48e780f096a67f62d49ad31077532ddca2038
|
4
|
+
data.tar.gz: c694cc364728d66643f9927ee40dbcb2188f033d4ea505346aa935f54e268587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 132f46dcd1f8d2f8dbffd06ebbd1c2267a3bf71844c41ddda9c1513e4ef2dd65372fec8e7404be2fb1d8288291dae392f16da62e4105ee9e3e91f935573290f8
|
7
|
+
data.tar.gz: 50dab8be4e2b3d359b9f1b6585554bc55230c9d45dbaa1131bca528372eb90cdc854827a6fc638bc18bde65c705acfa9a20d9f6c0e5b2d2fa90bc660c28acfe6
|
data/lib/nlpcloud.rb
CHANGED
@@ -61,7 +61,10 @@ module NLPCloud
|
|
61
61
|
|
62
62
|
def async_result(url)
|
63
63
|
response = RestClient.get(url, @headers)
|
64
|
-
|
64
|
+
|
65
|
+
if response.body && !response.body.empty?
|
66
|
+
JSON.parse(response.body)
|
67
|
+
end
|
65
68
|
end
|
66
69
|
|
67
70
|
def chatbot(text, context: nil, history: nil)
|
@@ -117,31 +120,24 @@ module NLPCloud
|
|
117
120
|
JSON.parse(response.body)
|
118
121
|
end
|
119
122
|
|
120
|
-
def generation(text,
|
121
|
-
end_sequence: nil, remove_input: nil,
|
122
|
-
|
123
|
-
temperature: nil, repetition_penalty: nil,
|
124
|
-
is_instruct: nil)
|
123
|
+
def generation(text, max_length: nil, length_no_input: nil,
|
124
|
+
end_sequence: nil, remove_input: nil, num_beams: nil,
|
125
|
+
num_return_sequences: nil, top_k: nil, top_p: nil,
|
126
|
+
temperature: nil, repetition_penalty: nil, bad_words: nil, remove_end_sequence: nil)
|
125
127
|
payload = {
|
126
128
|
'text' => text,
|
127
|
-
'min_length' => min_length,
|
128
129
|
'max_length' => max_length,
|
129
130
|
'length_no_input' => length_no_input,
|
130
131
|
'end_sequence' => end_sequence,
|
131
132
|
'remove_input' => remove_input,
|
132
|
-
'do_sample' => do_sample,
|
133
133
|
'num_beams' => num_beams,
|
134
|
-
'early_stopping' => early_stopping,
|
135
|
-
'no_repeat_ngram_size' => no_repeat_ngram_size,
|
136
134
|
'num_return_sequences' => num_return_sequences,
|
137
135
|
'top_k' => top_k,
|
138
136
|
'top_p' => top_p,
|
139
137
|
'temperature' => temperature,
|
140
138
|
'repetition_penalty' => repetition_penalty,
|
141
|
-
'length_penalty' => length_penalty,
|
142
139
|
'bad_words' => bad_words,
|
143
|
-
'remove_end_sequence' => remove_end_sequence
|
144
|
-
'is_instruct' => is_instruct
|
140
|
+
'remove_end_sequence' => remove_end_sequence
|
145
141
|
}
|
146
142
|
response = RestClient.post("#{@root_url}/generation", payload.to_json, @headers)
|
147
143
|
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.
|
4
|
+
version: 1.0.44
|
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-
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
|
-
rubygems_version: 3.
|
64
|
+
rubygems_version: 3.1.6
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Ruby client for the NLP Cloud API
|