Skip to content

Commit

Permalink
Bump version to 0.0.6
Browse files Browse the repository at this point in the history
This should solve an issue with compiling on Ruby 3.3.0-dev
  • Loading branch information
IAPark committed Sep 24, 2023
1 parent 8505679 commit fc170da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
tiktoken_ruby (0.0.5)
tiktoken_ruby (0.0.6)
rb_sys (~> 0.9.68)

GEM
Expand Down
14 changes: 9 additions & 5 deletions ext/tiktoken_ruby/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod core_bpe_wrapper;

use core_bpe_wrapper::CoreBPEWrapper;
use magnus::{define_module, function, prelude::*, Error, method, class, RModule, ExceptionClass};
use magnus::{class, define_module, function, method, prelude::*, Error, ExceptionClass, RModule};

fn r50k_base() -> CoreBPEWrapper {
let core_bpe = tiktoken_rs::r50k_base().unwrap();
Expand Down Expand Up @@ -38,14 +38,18 @@ fn init() -> Result<(), Error> {
factory_module.define_singleton_method("p50k_edit", function!(p50k_edit, 0))?;
factory_module.define_singleton_method("cl100k_base", function!(cl100k_base, 0))?;


let ext_module = module.define_module("Ext")?;
let bpe_class = ext_module.define_class("CoreBPE", class::object())?;

bpe_class.define_method("encode_ordinary", method!(CoreBPEWrapper::encode_ordinary, 1))?;
bpe_class.define_method(
"encode_ordinary",
method!(CoreBPEWrapper::encode_ordinary, 1),
)?;
bpe_class.define_method("encode", method!(CoreBPEWrapper::encode, 2))?;
bpe_class.define_method("encode_with_special_tokens", method!(CoreBPEWrapper::encode_with_special_tokens, 1))?;

bpe_class.define_method(
"encode_with_special_tokens",
method!(CoreBPEWrapper::encode_with_special_tokens, 1),
)?;

bpe_class.define_method("decode", method!(CoreBPEWrapper::decode, 1))?;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion lib/tiktoken_ruby/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Tiktoken
VERSION = "0.0.5"
VERSION = "0.0.6"
end

0 comments on commit fc170da

Please sign in to comment.