gliner 0.3.0 → 0.3.1
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 +4 -4
- data/README.md +3 -3
- data/lib/gliner/configuration.rb +1 -1
- data/lib/gliner/model.rb +1 -1
- data/lib/gliner/version.rb +1 -1
- data/lib/gliner.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da7bc04df38770206535e5aecd24afb8a9d19def94b51a042dc835cbf31528e2
|
|
4
|
+
data.tar.gz: '06579535719cc6db12f15ec3087876f51e9f6be756436bd2cf5a7fd7ff4d050b'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de08fa742fd1aa3745673d362e544d8f1ffc62397f47c72581da09dc911398b91fc75bb07f6daf0e6428f9107e42a54dd8c517f39bc9e8c61ceeb5e9ea944e83
|
|
7
|
+
data.tar.gz: 9dde5631269e9e8a90ad551cde633c5eb89fd1ccb6cd413c8f893f9b1df2e5e077cc39065135dfbd525d32cc47f4a65876873cc4b5a2b65daa268d0e7835a334
|
data/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Gliner.configure do |config|
|
|
|
22
22
|
# By default, the gem downloads the default model to .cache/
|
|
23
23
|
# Or set a local path explicitly:
|
|
24
24
|
# config.model = "/path/to/gliner2-multi-v1"
|
|
25
|
-
config.variant = :
|
|
25
|
+
config.variant = :int8
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday."
|
|
@@ -149,7 +149,7 @@ This implementation expects a directory containing:
|
|
|
149
149
|
- (optional) `config.json` with `max_width` and `max_seq_len`
|
|
150
150
|
|
|
151
151
|
One publicly available ONNX export is `cuerbot/gliner2-multi-v1` on Hugging Face.
|
|
152
|
-
By default, `
|
|
152
|
+
By default, `model_int8.onnx` is used; set `config.variant` (or `GLINER_MODEL_FILE`) to override.
|
|
153
153
|
Variants map to files as: `:fp16` → `model_fp16.onnx`, `:fp32` → `model.onnx`, `:int8` → `model_int8.onnx`.
|
|
154
154
|
|
|
155
155
|
You can also configure the model source directly:
|
|
@@ -194,7 +194,7 @@ If you omit `MODEL_DIR`, the console auto-downloads a public test model (configu
|
|
|
194
194
|
```bash
|
|
195
195
|
rake console
|
|
196
196
|
# or:
|
|
197
|
-
GLINER_REPO_ID=cuerbot/gliner2-multi-v1 GLINER_MODEL_FILE=
|
|
197
|
+
GLINER_REPO_ID=cuerbot/gliner2-multi-v1 GLINER_MODEL_FILE=model_int8.onnx rake console
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
Or:
|
data/lib/gliner/configuration.rb
CHANGED
data/lib/gliner/model.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Gliner
|
|
|
22
22
|
DEFAULT_MAX_WIDTH = 8
|
|
23
23
|
DEFAULT_MAX_SEQ_LEN = 512
|
|
24
24
|
|
|
25
|
-
def self.from_dir(dir, file: '
|
|
25
|
+
def self.from_dir(dir, file: 'model_int8.onnx')
|
|
26
26
|
config_path = File.join(dir, 'config.json')
|
|
27
27
|
config = File.exist?(config_path) ? JSON.parse(File.read(config_path)) : {}
|
|
28
28
|
|
data/lib/gliner/version.rb
CHANGED
data/lib/gliner.rb
CHANGED