The hugging-face gem only allows us to call the huggingface.co Inference API and we're unable to pull down models locally and run them on local machines.
We should be able to use @ankane's new transformers-ruby library to pull down and run models locally.
Tasks:
Replace hugging-face gem with transformers-ruby
Pick out suitable models to be used as default models for def embed, def complete and def chat.
Build out def chat() method. You should be able to use chat templates and pass an array of messages: [{...}, {...}, ...]. Additional information on Chat Templates.
Modify def embed(text:, model:) method to work with the new underlying transformers-ruby library.
Modify def complete(prompt:, model:) method to work with the new underlying transformers-ruby library.
Hey @andreibondarev, Informers might be a better fit for this (or useful as another option), as it's much easier to install (no need for LibTorch and a compiler). Also, it supports the text-generation pipeline (although I've only tried it with GPT-2, the default model).
Description
The hugging-face gem only allows us to call the huggingface.co Inference API and we're unable to pull down models locally and run them on local machines.
We should be able to use @ankane's new transformers-ruby library to pull down and run models locally.
Tasks:
hugging-face
gem withtransformers-ruby
def embed
,def complete
anddef chat
.def chat()
method. You should be able to use chat templates and pass an array ofmessages: [{...}, {...}, ...]
. Additional information on Chat Templates.def embed(text:, model:)
method to work with the new underlyingtransformers-ruby
library.def complete(prompt:, model:)
method to work with the new underlyingtransformers-ruby
library.