tiktoken_ruby 0.0.1-x64-mingw-ucrt → 0.0.2-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -6
- data/lib/tiktoken_ruby/3.1/tiktoken_ruby.so +0 -0
- data/lib/tiktoken_ruby/3.2/tiktoken_ruby.so +0 -0
- data/lib/tiktoken_ruby/version.rb +1 -1
- data/lib/tiktoken_ruby.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a76f3a21d5c1994e02b643393862b4d4183c40d5c2ad004cda1280b7ca4c3d9
|
4
|
+
data.tar.gz: fa20012e669bcd1ef57e6781488405c0436b65a960270a18e2603b1610278950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db8f73e134a5fdb08e8dbb520e01b62829f373cc7f6073ca80928e6deeb5e4fee30d9fb57dbb4f691b570edaafad7eb6e507ead8d588b975a1a1ebbe477e8489
|
7
|
+
data.tar.gz: 8f89833ea89e23fdc50d71ca927d69bc15ec45dc81e399e3014f66b854b039dc51bbb3faa5f468b478438aa34aa09cd4f2c7f6c7702e04dcee9b734e72a2a12f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/tiktoken_ruby.svg)](https://badge.fury.io/rb/tiktoken_ruby)
|
1
2
|
# tiktoken_ruby
|
2
3
|
|
3
4
|
[Tiktoken](https://github.com/openai/tiktoken) is BPE tokenizer from OpenAI used with their GPT models.
|
@@ -5,19 +6,21 @@ This is a wrapper around it aimed primarily at enabling accurate counts of GPT m
|
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
8
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
9
|
-
|
10
9
|
Install the gem and add to the application's Gemfile by executing:
|
11
10
|
|
12
|
-
$ bundle add
|
11
|
+
$ bundle add tiktoken_ruby
|
13
12
|
|
14
13
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
15
14
|
|
16
|
-
$ gem install
|
15
|
+
$ gem install tiktoken_ruby
|
17
16
|
|
18
17
|
## Usage
|
19
18
|
|
20
|
-
|
19
|
+
```ruby
|
20
|
+
encoding = Tiktoken::Encoding.r50k_base
|
21
|
+
tokens = encoding.encode("Hello world!")
|
22
|
+
puts encoding.decode(tokens)
|
23
|
+
```
|
21
24
|
|
22
25
|
## Development
|
23
26
|
|
@@ -27,7 +30,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
27
30
|
|
28
31
|
## Contributing
|
29
32
|
|
30
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/iapark/tiktoken_ruby.
|
31
34
|
|
32
35
|
## License
|
33
36
|
|
Binary file
|
Binary file
|
data/lib/tiktoken_ruby.rb
CHANGED
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
require_relative "tiktoken_ruby/version"
|
4
4
|
require_relative "tiktoken_ruby/encoding.rb"
|
5
|
-
|
5
|
+
|
6
|
+
begin
|
7
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
8
|
+
require_relative "tiktoken_ruby/#{$1}/tiktoken_ruby"
|
9
|
+
rescue LoadError
|
10
|
+
require_relative "tiktoken_ruby/tiktoken_ruby"
|
11
|
+
end
|
6
12
|
|
7
13
|
module Tiktoken
|
8
14
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiktoken_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- IAPark
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 3.
|
55
|
+
version: 3.1.0
|
56
56
|
requirements: []
|
57
57
|
rubygems_version: 3.4.4
|
58
58
|
signing_key:
|