Open developius opened 1 year ago
Hi, thanks for publishing the gem! I'm using it on Heroku with stack heroku-22 but getting an error when calling encoding_for_model. Locally it works just fine.
encoding_for_model
Ruby: 3.2.2 OS: Ubuntu 22.04
Here's a Dockerfile that exhibits the issue (tested on play-with-docker):
FROM heroku/heroku:22 RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB RUN curl -sSL https://get.rvm.io | bash -s stable RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && rvm install 3.2.2 && rvm use 3.2.2" RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && ruby -v" RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && gem install tiktoken" RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && ruby -e 'require \"tiktoken\"; Tiktoken.encoding_for_model(\"text-embedding-ada-002\")'"
And the error:
/usr/local/rvm/gems/ruby-3.2.2/gems/tiktoken-0.1.0-x86_64-linux/lib/tiktoken.rb:16:in `_encoding_for_model': Invalid model: (ArgumentError) Tiktoken._encoding_for_model(model, extra_special_tokens) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ from /usr/local/rvm/gems/ruby-3.2.2/gems/tiktoken-0.1.0-x86_64-linux/lib/tiktoken.rb:16:in `encoding_for_model' from -e:1:in `<main>'
On my Mac (M1), the Tiktoken.encoding_for_model("text-embedding-ada-002") works just fine.
Tiktoken.encoding_for_model("text-embedding-ada-002")
Any ideas what might be causing this? Perhaps an architecture problem?
I got it to segfault on Heroku too, when calling encoding_for_model:
Ever solve this issue?
Hi, thanks for publishing the gem! I'm using it on Heroku with stack heroku-22 but getting an error when calling
encoding_for_model
. Locally it works just fine.Ruby: 3.2.2 OS: Ubuntu 22.04
Here's a Dockerfile that exhibits the issue (tested on play-with-docker):
And the error:
On my Mac (M1), the
Tiktoken.encoding_for_model("text-embedding-ada-002")
works just fine.Any ideas what might be causing this? Perhaps an architecture problem?