clip-rb 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 29e8df54de90f811ae779c79b8430d07cf7f23cf0d1995ccb9d3dcd268357df2
4
+ data.tar.gz: 556ac48aef1f241fb28e2907a9e5ae6b77930c57ccd67c6ba2e89d7f0a09d63a
5
+ SHA512:
6
+ metadata.gz: af8f9334c49912107269621066863a22c393b54c13ed5464df7e7abd77803fc70a236bcf41bf5a1ad33ad5c6226e8741b5ae4198be0a2e84c117bb181306a2c8
7
+ data.tar.gz: 42db46f9e13d6792335607471c4250d272358da3e8fec24afdf23510da171bec9a88b0853575abdb53196676641f3a7da7141c62cd67656d6071a3f7769f00d9
File without changes
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Krzysztof Hasiński
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # clip-rb
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/clip-rb.svg)](https://badge.fury.io/rb/clip-rb)
4
+ [![Test](https://github.com/khasinski/clip-rb/workflows/clip-rb/badge.svg)](https://github.com/khasinski/clip-rb/actions/workflows/main.yml)
5
+
6
+ Clip replacement that uses ONNX models. No Python required!
7
+
8
+ ## Requirements
9
+
10
+ - Ruby 3.0.0 or later
11
+ - ONNX models for CLIP (downloaded automatically on first use)
12
+
13
+ ## Installation
14
+
15
+ Install the gem and add to the application's Gemfile by executing:
16
+
17
+ ```bash
18
+ bundle add clip-rb
19
+ ```
20
+
21
+ If bundler is not being used to manage dependencies, install the gem by executing:
22
+
23
+ ```bash
24
+ gem install clip-rb
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ```ruby
30
+ require 'clip'
31
+
32
+ clip = Clip::Model.new
33
+
34
+ clip.encode_text("a photo of a cat") # => [0.15546110272407532, 0.07329428941011429, ...]
35
+
36
+ clip.encode_image("test/fixtures/test.jpg") # => [0.22115306556224823,, 0.19343754649162292, ...]
37
+ ```
38
+
39
+ ## CLI
40
+
41
+ Additionally you can fetch embeddings by calling:
42
+
43
+ ```bash
44
+ $ clip-embed-text "a photo of a cat"
45
+ $ clip-embed-image test/fixtures/test.jpg
46
+ ```
47
+
48
+ Use KNN vector search to find similar images, remember to use cosine distance!
49
+
50
+ ## Development
51
+
52
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
53
+
54
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
55
+
56
+ ## Contributing
57
+
58
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/clip-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/clip-rb/blob/main/CODE_OF_CONDUCT.md).
59
+
60
+ ## License
61
+
62
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
63
+
64
+ ## Code of Conduct
65
+
66
+ Everyone interacting in the clip-rb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/clip-rb/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/clip"
4
+
5
+
6
+ if ARGV.length != 1
7
+ puts "Usage: clip-embed-image <image_file>"
8
+ exit 1
9
+ end
10
+
11
+ begin
12
+ puts Clip::Model.new.encode_image(ARGV[0])
13
+ rescue => e
14
+ puts "Error: #{e.message}"
15
+ exit 1
16
+ end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/clip"
4
+
5
+
6
+ if ARGV.length != 1
7
+ puts "Usage: clip-embed-text <text>"
8
+ exit 1
9
+ end
10
+
11
+ begin
12
+ puts Clip::Model.new.encode_text(ARGV[0])
13
+ rescue => e
14
+ puts "Error: #{e.message}"
15
+ exit 1
16
+ end
Binary file
@@ -0,0 +1,5 @@
1
+ module Clip
2
+ class ImagePreprocessor
3
+
4
+ end
5
+ end
data/lib/clip/model.rb ADDED
@@ -0,0 +1,42 @@
1
+ require "onnxruntime"
2
+
3
+ module Clip
4
+ class Model
5
+ def initialize(
6
+ textual_model_path: ".clip_models/textual.onnx",
7
+ visual_model_path: ".clip_models/visual.onnx",
8
+ tokenizer: Clip::Tokenizer.new,
9
+ image_preprocessor: Clip::ImagePreprocessor.new,
10
+ download_models: true,
11
+ download_dir: ".clip_models"
12
+ )
13
+ @textual_model_path = textual_model_path
14
+ @visual_model_path = visual_model_path
15
+ Clip.download_models(download_dir) if download_models && !Clip.models_exist?(textual_model_path: textual_model_path, visual_model_path: visual_model_path)
16
+ @tokenizer = tokenizer
17
+ @image_preprocessor = image_preprocessor
18
+ end
19
+
20
+ def encode_text(text)
21
+ tokens = tokenizer.encode(text)
22
+ text_model.predict({ input: [ tokens ] })["output"].first
23
+ end
24
+
25
+ def encode_image(image)
26
+ image = image_preprocessor.preprocess(image).to_a
27
+ image_model.predict({ input: [ image ] })["output"].first
28
+ end
29
+
30
+ def text_model
31
+ @text_model ||= OnnxRuntime::Model.new(textual_model_path)
32
+ end
33
+
34
+ def image_model
35
+ @image_model ||= OnnxRuntime::Model.new(visual_model_path)
36
+ end
37
+
38
+ private
39
+
40
+ attr_reader :textual_model_path, :visual_model_path, :tokenizer, :image_preprocessor
41
+ end
42
+ end
@@ -0,0 +1,143 @@
1
+ require "zlib"
2
+ require "set"
3
+
4
+ module Clip
5
+ class Tokenizer
6
+ INPUT_VECTOR_SIZE = 77
7
+
8
+ def initialize(bpe_path = __dir__ + "/../bpe_simple_vocab_16e6.txt.gz")
9
+ @byte_encoder = bytes_to_unicode
10
+ @byte_decoder = @byte_encoder.invert
11
+ merges = Zlib::GzipReader.open(bpe_path).read.split("\n")[1..(49152 - 256 - 2)]
12
+ merges = merges.map { |merge| merge.split(" ") }
13
+ vocab = @byte_encoder.values
14
+ vocab += vocab.map { |v| "#{v}</w>" }
15
+ merges.each { |merge| vocab << merge.join }
16
+ vocab += [ "<|startoftext|>", "<|endoftext|>" ]
17
+ @encoder = Hash[vocab.zip(0...vocab.size)]
18
+ @decoder = @encoder.invert
19
+ @bpe_ranks = Hash[merges.zip(0...merges.size)]
20
+ @cache = { "<|startoftext|>" => "<|startoftext|>", "<|endoftext|>" => "<|endoftext|>" }
21
+ @pattern = Regexp.new("<\\|startoftext\\|>|<\\|endoftext\\|>|'s|'t|'re|'ve|'m|'ll|'d|\\p{L}+|\\p{N}|[^\\s\\p{L}\\p{N}]+", Regexp::IGNORECASE)
22
+ end
23
+
24
+ def bytes_to_unicode
25
+ # Define base ranges for printable ASCII and extended Unicode
26
+ bs = (33..126).to_a + (161..172).to_a + (174..255).to_a # Printable characters
27
+ cs = bs.dup # Start with the same set of characters for mapping
28
+
29
+ # Map remaining bytes (0–255) to unique Unicode codepoints starting from 256
30
+ n = 0
31
+ (0...256).each do |b|
32
+ unless bs.include?(b)
33
+ bs << b # Add the byte to the mapping
34
+ cs << (256 + n) # Assign a unique Unicode codepoint
35
+ n += 1 # Increment the counter for unmapped bytes
36
+ end
37
+ end
38
+
39
+ # Convert codepoints to UTF-8 strings
40
+ cs = cs.map { |n| n.chr(Encoding::UTF_8) }
41
+
42
+ # Create a hash mapping bytes (0–255) to Unicode strings
43
+ Hash[bs.zip(cs)]
44
+ end
45
+
46
+ def get_pairs(word)
47
+ pairs = Set.new
48
+ prev_char = word[0]
49
+ word[1..-1].each do |char|
50
+ pairs.add([ prev_char, char ])
51
+ prev_char = char
52
+ end
53
+ pairs
54
+ end
55
+
56
+ def basic_clean(text)
57
+ text
58
+ end
59
+
60
+ def whitespace_clean(text)
61
+ text.gsub(/\s+/, " ").strip
62
+ end
63
+
64
+ def bpe(token)
65
+ return @cache[token] if @cache.key?(token)
66
+
67
+ word = token.chars[0..-2] + [ "#{token[-1]}</w>" ]
68
+ pairs = get_pairs(word)
69
+
70
+ until pairs.empty?
71
+ bigram = pairs.min_by { |pair| @bpe_ranks.fetch(pair, Float::INFINITY) }
72
+ break unless @bpe_ranks.key?(bigram)
73
+
74
+ first, second = bigram
75
+ new_word = []
76
+ i = 0
77
+ while i < word.size
78
+ j = word[i..-1]&.index(first)
79
+ j = j.nil? ? nil : j + i
80
+
81
+ if j.nil?
82
+ new_word.concat(word[i..-1])
83
+ break
84
+ else
85
+ new_word.concat(word[i...j])
86
+ if word[j] == first && word[j + 1] == second
87
+ new_word << "#{first}#{second}"
88
+ i = j + 2
89
+ else
90
+ new_word << word[j]
91
+ i = j + 1
92
+ end
93
+ end
94
+ end
95
+
96
+ word = new_word
97
+ break if word.size == 1
98
+
99
+ pairs = get_pairs(word)
100
+ end
101
+
102
+ result = word.join(" ")
103
+ @cache[token] = result
104
+ result
105
+ end
106
+
107
+ def encode(text)
108
+ bpe_tokens = []
109
+ cleaned_text = whitespace_clean(basic_clean(text)).downcase
110
+ cleaned_text = "<|startoftext|>#{cleaned_text}<|endoftext|>"
111
+ cleaned_text.scan(@pattern) do |token|
112
+ utf8_bytes = token.encode("utf-8").bytes
113
+
114
+ mapped_chars = utf8_bytes.map do |b|
115
+ @byte_encoder[b]
116
+ end
117
+ encoded = mapped_chars.join
118
+
119
+ bpe_subtokens = bpe(encoded).split(" ")
120
+
121
+ bpe_subtokens.each do |subtok|
122
+ bpe_tokens << @encoder[subtok]
123
+ end
124
+ end
125
+ pad_array(bpe_tokens)
126
+ end
127
+
128
+ def decode(tokens)
129
+ text = tokens.map { |token| @decoder[token] }.join
130
+ text = text.gsub("</w>", " ")
131
+
132
+ decoded_bytes = text.each_char.map do |c|
133
+ @byte_decoder[c]
134
+ end
135
+
136
+ decoded_bytes.compact.pack("C*").force_encoding("utf-8")
137
+ end
138
+
139
+ def pad_array(array)
140
+ array.fill(0, array.length...INPUT_VECTOR_SIZE).first(INPUT_VECTOR_SIZE)
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Clip
4
+ VERSION = "0.1.0"
5
+ end
data/lib/clip.rb ADDED
@@ -0,0 +1,50 @@
1
+ require "net/http"
2
+ require "fileutils"
3
+ require_relative "clip/model"
4
+ require_relative "clip/tokenizer"
5
+ require_relative "clip/image_preprocessor"
6
+ require "logger"
7
+
8
+ module Clip
9
+ attr_accessor :logger
10
+
11
+ BASE_URL = "https://huggingface.co/khasinski/"
12
+ MODELS = {
13
+ textual: "clip-ViT-B-32-onnx/resolve/main/textual.onnx?download=true",
14
+ visual: "clip-ViT-B-32-onnx/resolve/main/visual.onnx?download=true"
15
+ }
16
+
17
+ def self.download_models(download_dir)
18
+ logger ||= Logger.new(STDOUT)
19
+ FileUtils.mkdir_p(download_dir)
20
+
21
+ MODELS.each do |type, path|
22
+ uri = URI.join(BASE_URL, path)
23
+ logger.info("Downloading #{type} model from #{uri}")
24
+
25
+ while true
26
+ response = Net::HTTP.get_response(uri)
27
+
28
+ if response.is_a?(Net::HTTPRedirection)
29
+ logger.info("Redirected to #{response['location']}")
30
+ uri = URI.parse(response['location']) # Update URI to the redirect location
31
+ next
32
+ elsif response.is_a?(Net::HTTPSuccess)
33
+ file_path = File.join(download_dir, "#{type}.onnx")
34
+ File.open(file_path, 'wb') do |file|
35
+ file.write(response.body) # Write the body directly for simplicity
36
+ end
37
+ logger.info("Successfully downloaded #{type} model")
38
+ break
39
+ else
40
+ logger.error("Failed to download #{type} model from #{uri}: #{response.code} #{response.message}")
41
+ raise "Failed to download #{type} model from #{uri}"
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ def self.models_exist?(textual_model_path:, visual_model_path:)
48
+ File.exist?(textual_model_path) && File.exist?(visual_model_path)
49
+ end
50
+ end
data/sig/clip/rb.rbs ADDED
@@ -0,0 +1,6 @@
1
+ module Clip
2
+ module Rb
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: clip-rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Krzysztof Hasiński
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-01-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: onnxruntime
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: net-http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.6.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: zlib
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: logger
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.6'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.6'
69
+ description: OpenAI CLIP embeddings, uses ONNX models. Allows to create embeddings
70
+ for images and text
71
+ email:
72
+ - krzysztof.hasinski@gmail.com
73
+ executables:
74
+ - clip-embed-image
75
+ - clip-embed-text
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".clip_models/.gitkeep"
80
+ - ".rspec"
81
+ - CODE_OF_CONDUCT.md
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - exe/clip-embed-image
86
+ - exe/clip-embed-text
87
+ - lib/bpe_simple_vocab_16e6.txt.gz
88
+ - lib/clip.rb
89
+ - lib/clip/image_preprocessor.rb
90
+ - lib/clip/model.rb
91
+ - lib/clip/tokenizer.rb
92
+ - lib/clip/version.rb
93
+ - sig/clip/rb.rbs
94
+ homepage: https://github.com/khasinski/clip-rb
95
+ licenses:
96
+ - MIT
97
+ metadata:
98
+ homepage_uri: https://github.com/khasinski/clip-rb
99
+ source_code_uri: https://github.com/khasinski/clip-rb
100
+ changelog_uri: https://github.com/khasinski/clip-rb/CHANGELOG.md
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 3.0.0
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubygems_version: 3.5.22
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: OpenAI CLIP embeddings, uses ONNX models
120
+ test_files: []