transformers-rb 0.1.5 → 0.1.7

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: 815a531b2876ca2f66d9df65e13a08f42ab0b4a98d0d1ef459961fc3069faaa7
4
- data.tar.gz: 842158dd34cd785efff7a6df7524acd019afc6ead7738cfd9ddf6efadb89d97d
3
+ metadata.gz: c1fa37e7471df9836adbb814ac2098b685fd71d879bc83778e97a200db6c9d1b
4
+ data.tar.gz: 99d487b130a5cf67f7c853eeb4d57f17b6cd7d9fe28cf0d39e31d1172ff99936
5
5
  SHA512:
6
- metadata.gz: 2a4fa39c9d32b4ba83eeafe128d10af0873a910807ad67870359e8bffcdf94bdeeb18dea8bc0b2372926ded909e8223a2603388297aad357bca26ea0c6eb0baa
7
- data.tar.gz: bfac7d5c91e91bbbf1770ea71a9a9c69bca71c1e0ded3b0ca696156c99c331a5988879a3cf48731145db7be1d1c1b14dc7e573b728e1d1a123faa251ab56a560
6
+ metadata.gz: a1849c202c5d053eb82643ff1050594b26520fa53ee49e70a33a37ff39ee8e22244ee5ff799ee7961d7434030dd715d2b15a8ba9e7bf75585b947b8f73f36924
7
+ data.tar.gz: b577a028df70e8b90840efb88e49793a1ae5a26faa7420e7fbafd8d1aef1ae55accd025713866095d678dbad9fcdbfd2b757eb89b78172da3fcac7800535342f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.1.7 (2026-01-07)
2
+
3
+ - Switched to `cgi/escape` for Ruby 4.0
4
+
5
+ ## 0.1.6 (2024-12-29)
6
+
7
+ - Fixed error with failed HTTP requests
8
+ - Fixed warning with Ruby 3.4
9
+
1
10
  ## 0.1.5 (2024-11-01)
2
11
 
3
12
  - Fixed error with pipelines when called more than 10 times
@@ -24,7 +24,7 @@ module Transformers
24
24
  def hf_raise_for_status(response, endpoint_name: nil)
25
25
  begin
26
26
  response.value unless response.is_a?(Net::HTTPRedirection)
27
- rescue
27
+ rescue => e
28
28
  error_code = response["X-Error-Code"]
29
29
  error_message = response["X-Error-Message"]
30
30
 
@@ -36,7 +36,7 @@ module Transformers
36
36
 
37
37
  # Setting the position-ids to the registered buffer in constructor, it helps
38
38
  # when tracing the model without passing position-ids, solves
39
- # isues similar to issue #5664
39
+ # issues similar to issue #5664
40
40
  if @position_ids
41
41
  position_ids = @position_ids[0.., 0...seq_length]
42
42
  else
@@ -166,7 +166,7 @@ module Transformers
166
166
  end
167
167
 
168
168
  def preprocess(example, padding: "do_not_pad", doc_stride: nil, max_question_len: 64, max_seq_len: nil)
169
- # XXX: This is specal, args_parser will not handle anything generator or dataset like
169
+ # XXX: This is special, args_parser will not handle anything generator or dataset like
170
170
  # For those we expect user to send a simple valid example either directly as a SquadExample or simple dict.
171
171
  # So we still need a little sanitation here.
172
172
  if example.is_a?(Hash)
@@ -1,4 +1,5 @@
1
1
  module Transformers
2
+ # TODO remove in 0.2.0
2
3
  class SentenceTransformer
3
4
  def initialize(model_id)
4
5
  @model_id = model_id
@@ -1,3 +1,3 @@
1
1
  module Transformers
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/transformers.rb CHANGED
@@ -5,7 +5,7 @@ require "tokenizers"
5
5
  require "torch-rb"
6
6
 
7
7
  # stdlib
8
- require "cgi"
8
+ require "cgi/escape"
9
9
  require "fileutils"
10
10
  require "io/console"
11
11
  require "json"
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transformers-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: numo-narray
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +79,6 @@ dependencies:
66
79
  - - ">="
67
80
  - !ruby/object:Gem::Version
68
81
  version: 0.17.1
69
- description:
70
82
  email: andrew@ankane.org
71
83
  executables: []
72
84
  extensions: []
@@ -150,7 +162,6 @@ homepage: https://github.com/ankane/transformers-ruby
150
162
  licenses:
151
163
  - Apache-2.0
152
164
  metadata: {}
153
- post_install_message:
154
165
  rdoc_options: []
155
166
  require_paths:
156
167
  - lib
@@ -165,8 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
176
  - !ruby/object:Gem::Version
166
177
  version: '0'
167
178
  requirements: []
168
- rubygems_version: 3.5.16
169
- signing_key:
179
+ rubygems_version: 4.0.3
170
180
  specification_version: 4
171
181
  summary: State-of-the-art transformers for Ruby
172
182
  test_files: []