gpt4all 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -5
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -2
- data/lib/gpt4all/conversational_ai.rb +23 -6
- data/lib/gpt4all/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ef21af70c63628f51e23eeee9a4958227a5789c43323c792676eef52289300
|
4
|
+
data.tar.gz: 19271183c40dffbae53dc3e171510ed787edbebdbb33ae432c92f9b0edcc0972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c929aa6408d5f6668ee0c6513968e64e0ee2e7ec4f71f87a5fe24de916a98300904a68837d2b8aaf2970754dfdd3a21f241e98ebde3225af31a64c93044d1a5
|
7
|
+
data.tar.gz: 2ef1a65e439ea312d01b7bb0445a1a0aed89981b0b7a6546ab3914f6bc8294cad196cb1d47f7036e4cfb32d6e8bde27a3067862e7eb941c3884b3e905a80fc52
|
data/CHANGELOG.md
CHANGED
@@ -4,12 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [Unreleased]
|
8
7
|
|
9
|
-
## [0.0.
|
8
|
+
## [0.0.5] - 2023-04-18
|
10
9
|
|
11
|
-
-
|
10
|
+
- [Fix error "private method gets called on Process::Waiter"]() by [Francis](https://github.com/francis)
|
11
|
+
- Fix write_chunks_to_file
|
12
|
+
|
13
|
+
## [0.0.4] - 2023-04-11
|
14
|
+
|
15
|
+
- check md5 when downloading model file
|
16
|
+
- CI is working for multiple ruby version
|
12
17
|
|
13
|
-
## [0.0.2] - 2023-04-07
|
14
18
|
|
15
|
-
- updated changelog link
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gpt4all (0.0.
|
4
|
+
gpt4all (0.0.5)
|
5
5
|
faraday (~> 2.7)
|
6
6
|
os (~> 1.1)
|
7
7
|
tty-progressbar (~> 0.18.2)
|
@@ -19,6 +19,9 @@ GEM
|
|
19
19
|
byebug (11.1.3)
|
20
20
|
crack (0.4.5)
|
21
21
|
rexml
|
22
|
+
debug (1.7.2)
|
23
|
+
irb (>= 1.5.0)
|
24
|
+
reline (>= 0.3.1)
|
22
25
|
diff-lcs (1.5.0)
|
23
26
|
dotenv (2.8.1)
|
24
27
|
faraday (2.7.4)
|
@@ -26,6 +29,9 @@ GEM
|
|
26
29
|
ruby2_keywords (>= 0.0.4)
|
27
30
|
faraday-net_http (3.0.2)
|
28
31
|
hashdiff (1.0.1)
|
32
|
+
io-console (0.6.0)
|
33
|
+
irb (1.6.4)
|
34
|
+
reline (>= 0.3.0)
|
29
35
|
json (2.6.3)
|
30
36
|
os (1.1.4)
|
31
37
|
parallel (1.22.1)
|
@@ -35,6 +41,8 @@ GEM
|
|
35
41
|
rainbow (3.1.1)
|
36
42
|
rake (13.0.6)
|
37
43
|
regexp_parser (2.7.0)
|
44
|
+
reline (0.3.3)
|
45
|
+
io-console (~> 0.5)
|
38
46
|
rexml (3.2.5)
|
39
47
|
rspec (3.12.0)
|
40
48
|
rspec-core (~> 3.12.0)
|
@@ -90,6 +98,7 @@ PLATFORMS
|
|
90
98
|
aarch64-linux-musl
|
91
99
|
arm64-darwin-21
|
92
100
|
arm64-darwin-22
|
101
|
+
x86_64-darwin-21
|
93
102
|
x86_64-linux
|
94
103
|
x86_64-linux-musl
|
95
104
|
|
@@ -97,6 +106,7 @@ DEPENDENCIES
|
|
97
106
|
brakeman
|
98
107
|
bundler-audit
|
99
108
|
byebug
|
109
|
+
debug
|
100
110
|
dotenv
|
101
111
|
gpt4all!
|
102
112
|
rake (~> 13.0)
|
@@ -108,4 +118,4 @@ DEPENDENCIES
|
|
108
118
|
webmock
|
109
119
|
|
110
120
|
BUNDLED WITH
|
111
|
-
2.4.
|
121
|
+
2.4.7
|
@@ -62,7 +62,9 @@ module Gpt4all
|
|
62
62
|
def stop_bot
|
63
63
|
return unless bot
|
64
64
|
|
65
|
-
bot.
|
65
|
+
bot[0].close
|
66
|
+
bot[1].close
|
67
|
+
bot[2].exit
|
66
68
|
@bot = nil
|
67
69
|
@bot_pid = nil
|
68
70
|
end
|
@@ -77,7 +79,7 @@ module Gpt4all
|
|
77
79
|
|
78
80
|
begin
|
79
81
|
bot.first.puts(input)
|
80
|
-
response =
|
82
|
+
response = read_from_bot
|
81
83
|
rescue StandardError => e
|
82
84
|
puts "Error during prompt: #{e.message}"
|
83
85
|
restart_bot
|
@@ -157,7 +159,7 @@ module Gpt4all
|
|
157
159
|
def write_chunks_to_file(response, destination, progress_bar)
|
158
160
|
File.open(destination, 'wb') do |file|
|
159
161
|
downloaded_size = 0
|
160
|
-
response.body.
|
162
|
+
response.body.each(2048) do |chunk|
|
161
163
|
progress_bar.advance(chunk.bytesize)
|
162
164
|
file.write(chunk)
|
163
165
|
downloaded_size += chunk.bytesize
|
@@ -183,13 +185,28 @@ module Gpt4all
|
|
183
185
|
puts 'MD5 signature verified successfully.'
|
184
186
|
end
|
185
187
|
|
186
|
-
|
188
|
+
# remove the stop character from end of the output
|
189
|
+
def strip_stop(output, stop)
|
190
|
+
output[0...output.rindex(stop)]
|
191
|
+
end
|
192
|
+
|
193
|
+
def read_from_bot(stop: '>')
|
194
|
+
output = ''
|
187
195
|
loop do
|
188
|
-
|
189
|
-
|
196
|
+
new_output = bot[1].read_nonblock(2048)
|
197
|
+
output += new_output
|
198
|
+
return strip_stop(output, stop) if new_output&.include?(stop)
|
199
|
+
|
200
|
+
rescue IO::WaitReadable
|
201
|
+
bot[1].wait_readable
|
202
|
+
retry
|
190
203
|
end
|
191
204
|
end
|
192
205
|
|
206
|
+
def wait_for_bot_ready
|
207
|
+
read_from_bot
|
208
|
+
end
|
209
|
+
|
193
210
|
def ensure_bot_is_ready
|
194
211
|
raise 'Bot is not initialized.' unless bot
|
195
212
|
end
|
data/lib/gpt4all/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpt4all
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaigouk Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|