Created
April 18, 2026 12:52
-
-
Save peterc/bb77a9d3eed9f52577439ba5fb01edea to your computer and use it in GitHub Desktop.
Create an embedding from Ruby using a good small model, quickly on CPU only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "informers" | |
| MODEL = "Snowflake/snowflake-arctic-embed-s" | |
| embedder = Informers.pipeline( | |
| "embedding", | |
| MODEL, | |
| dtype: "int8", | |
| device: "cpu", | |
| ) | |
| vec = embedder.("hello world") | |
| puts vec.length | |
| puts vec.first(5).inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment