gpt4all 0.0.4 → 0.0.5

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: bcbc4d0a68ce0e29cae2ded264680ea57c279b0cb514545b199b6c03141b6af4
4
- data.tar.gz: 9662b980b9c22ec94d252ac5793f48deba90739db2804757438f2a345632cff2
3
+ metadata.gz: 63ef21af70c63628f51e23eeee9a4958227a5789c43323c792676eef52289300
4
+ data.tar.gz: 19271183c40dffbae53dc3e171510ed787edbebdbb33ae432c92f9b0edcc0972
5
5
  SHA512:
6
- metadata.gz: a6f1e2c6146a365aee6ec0df861113b6e9ea452781f19473429147d563c32a7d1897a55aeeab72dfc66d64e0e32a6cf0a0f9ddf70062a154ad84fbb6766fe14a
7
- data.tar.gz: 13e4b5cd8aa2dbbf7d707d8e484c8ddebb3699aed13c761813085b9b55ae4e7d7145d48fb6a2549d66eb04f59eb5528a0caf5d579bacff04f2fd7bfec24b5e86
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.1] - 2023-04-07
8
+ ## [0.0.5] - 2023-04-18
10
9
 
11
- - Initial release
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
@@ -14,6 +14,7 @@ gem 'rubocop', '~> 1.21'
14
14
  gem 'brakeman'
15
15
  gem 'bundler-audit'
16
16
  gem 'byebug'
17
+ gem 'debug'
17
18
  gem 'dotenv'
18
19
 
19
20
  gem 'rubocop-performance'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gpt4all (0.0.4)
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.10
121
+ 2.4.7
@@ -62,7 +62,9 @@ module Gpt4all
62
62
  def stop_bot
63
63
  return unless bot
64
64
 
65
- bot.each(&:close)
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 = bot.last.gets.strip
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.each_chunk do |chunk|
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
- def wait_for_bot_ready
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
- output = bot.last.gets
189
- break if output&.include?('>')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gpt4all
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
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
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 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday