← 开源
ankane

transformers-ruby

State-of-the-art transformers for Ruby

AI EngineeringAccess modelsRuby
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
729
Star
12
Fork
+0
本周
3
贡献者
创建于 2024-08-19 · 更新于 2026-09-05 · 今日第 14448 名
主要开发者
ankanedefault-antonkaelonswanton

ankane/transformers-ruby 排名第 14,448,有 729 个星标。

同类别比较

ankane/transformers-ruby 排名第 14,448,此处有 8 个同类条目;microsoft/teams-sdk 排名第 14,441。

同类别比较
名称排名指标
team-openpm/workgpt14,430
语言:
TypeScript
星标数:
731
分叉数:
57
简介:
A GPT agent framework for invoking APIs
Chen-zexi/open-ptc-agent14,434
语言:
Python
星标数:
730
分叉数:
90
简介:
An open source implementation of code execution with MCP (Programatic Tool Calling)
YonkoSam/whatsapp-python-chatbot14,436
语言:
Python
星标数:
730
分叉数:
218
简介:
WhatsApp Chatbot using Gemini + WasenderAPI
microsoft/teams-sdk14,441
语言:
TypeScript
星标数:
730
分叉数:
271
简介:
SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
ltjed/freephdlabor14,456
语言:
Python
星标数:
729
分叉数:
80
简介:
freephdlabor: customizing personalized multiagent systems that researchs 24/7 on your own scientific problem
dylanshine/openai-kit14,463
语言:
Swift
星标数:
728
分叉数:
115
简介:
A community Swift package used to interact with the OpenAI API
kdcokenny/opencode-worktree14,467
语言:
TypeScript
星标数:
728
分叉数:
41
简介:
Zero-friction git worktrees for OpenCode. Auto-spawns terminals, syncs files, cleans up on exit.
liveloveapp/hashbrown14,469
语言:
TypeScript
星标数:
728
分叉数:
64
简介:
Hashbrown is a framework for building agents that run the browser. Built for Angular and React.
关键参数与规格
关键参数与规格
参数值
语言Ruby
类别AI Engineering
子类别Access models
关键词Client integration, Embeddings, LocalAI, Retrieval
星标数729
分叉数12
贡献者3
创建日期2024-08-19
更新日期2026-09-05
1 天星标数0
7 天星标数0
排名14,448
上次排名14,302
排名变化-146
7 天星标排名14,480
上次 7 天星标排名14,497
7 天星标排名变化17
总星标排名14,387
上次总星标排名14,355
总星标排名变化-32
国家USA
README 摘录

rb :slightly_smiling_face: State-of-the-art transformers for Ruby For fast inference, check out Informers :fire: Installation First, install Torch. Then add this line to your application’s Gemfile: Getting Started Models Pipelines Models Embedding sentence-transformers/all-MiniLM-L6-v2 sentence-transformers/multi-qa-MiniLM-L6-cos-v1 sentence-transformers/all-mpnet-base-v2 sentence-transformers/paraphrase-MiniLM-L6-v2 mixedbread-ai/mxbai-embed-large-v1 thenlper/gte-small intfloat/e5-base-v2 BAAI/bge-base-en

-v1. 5 Snowflake/snowflake-arctic-embed-m-v1. 5 Sparse embedding opensearch-project/opensearch-neural-sparse-encoding-v1 Reranking mixedbread-ai/mxbai-rerank-base-v1 BAAI/bge-reranker-base sentence-transformers/all-MiniLM-L6-v2 Docs sentence-transformers/multi-qa-MiniLM-L6-cos-v1 Docs sentence-transformers/all-mpnet-base-v2 Docs sentence-transformers/paraphrase-MiniLM-L6-v2 Docs mixedbread-ai/mxbai-embed-large-v1 Docs thenlper/gte-small Docs intfloat/e5-base-v2 Docs BAAI/bge-base-en-v1

. 5 Docs Snowflake/snowflake-arctic-embed-m-v1. 5 Docs opensearch-project/opensearch-neural-sparse-encoding-v1 Docs mixedbread-ai/mxbai-rerank-base-v1 Docs BAAI/bge-reranker-base Docs Pipelines Text Vision Text Embedding Reranking Named-entity recognition Sentiment analysis Question answering Feature extraction Vision Image classification Image feature extraction API This library follows the Transformers Python API. The following model architectures are currently supported: BERT DeBERTa-v2 DistilBERT MPNet ViT XLM-RoBERTa History View the changelog Contributing Everyone

is encouraged to help improve this project. Here are a few ways you can help: Report bugs Fix bugs and submit pull requests Write, clarify, or fix documentation Suggest or add new features To get started with development:

常见问题

记录了多少星标和分叉?

ankane/transformers-ruby 有 729 个星标和 12 个分叉。

仓库排名是多少?

ankane/transformers-ruby 排名第 14,448。

记录的语言和类别是什么?

ankane/transformers-ruby 有 729 个星标,语言为 Ruby,类别为 AI Engineering。

哪个仓库排名最接近?

ankane/transformers-ruby 与 microsoft/teams-sdk 比较,后者排名第 14,441,有 730 个星标。

README

Transformers.rb

:slightly_smiling_face: State-of-the-art transformers for Ruby

For fast inference, check out Informers :fire:

Installation

First, install Torch.rb.

Then add this line to your application’s Gemfile:

gem "transformers-rb"

Getting Started

Models

Embedding

Sparse embedding

Reranking

sentence-transformers/all-MiniLM-L6-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/all-MiniLM-L6-v2")
embeddings = model.(sentences)

sentence-transformers/multi-qa-MiniLM-L6-cos-v1

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("embedding", "sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
query_embedding = model.(query)
doc_embeddings = model.(docs)
scores = doc_embeddings.map { |e| e.zip(query_embedding).sum { |d, q| d * q } }
doc_score_pairs = docs.zip(scores).sort_by { |d, s| -s }

sentence-transformers/all-mpnet-base-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/all-mpnet-base-v2")
embeddings = model.(sentences)

sentence-transformers/paraphrase-MiniLM-L6-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/paraphrase-MiniLM-L6-v2")
embeddings = model.(sentences)

mixedbread-ai/mxbai-embed-large-v1

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "mixedbread-ai/mxbai-embed-large-v1")
embeddings = model.(input)

thenlper/gte-small

Docs

sentences = ["That is a happy person", "That is a very happy person"]

model = Transformers.pipeline("embedding", "thenlper/gte-small")
embeddings = model.(sentences)

intfloat/e5-base-v2

Docs

doc_prefix = "passage: "
query_prefix = "query: "

input = [
  doc_prefix + "Ruby is a programming language created by Matz",
  query_prefix + "Ruby creator"
]

model = Transformers.pipeline("embedding", "intfloat/e5-base-v2")
embeddings = model.(input)

BAAI/bge-base-en-v1.5

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "BAAI/bge-base-en-v1.5")
embeddings = model.(input)

Snowflake/snowflake-arctic-embed-m-v1.5

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "Snowflake/snowflake-arctic-embed-m-v1.5")
embeddings = model.(input, pooling: "cls")

opensearch-project/opensearch-neural-sparse-encoding-v1

Docs

docs = ["The dog is barking", "The cat is purring", "The bear is growling"]

model_id = "opensearch-project/opensearch-neural-sparse-encoding-v1"
model = Transformers::AutoModelForMaskedLM.from_pretrained(model_id)
tokenizer = Transformers::AutoTokenizer.from_pretrained(model_id)
special_token_ids = tokenizer.special_tokens_map.map { |_, token| tokenizer.vocab[token] }

feature = tokenizer.(docs, padding: true, truncation: true, return_tensors: "pt", return_token_type_ids: false)
output = model.(**feature)[0]

values, _ = Torch.max(output * feature[:attention_mask].unsqueeze(-1), dim: 1)
values = Torch.log(1 + Torch.relu(values))
values[0.., special_token_ids] = 0
embeddings = values.to_a

mixedbread-ai/mxbai-rerank-base-v1

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("reranking", "mixedbread-ai/mxbai-rerank-base-v1")
result = model.(query, docs)

BAAI/bge-reranker-base

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("reranking", "BAAI/bge-reranker-base")
result = model.(query, docs)

Pipelines

Text

Embedding

embed = Transformers.pipeline("embedding")
embed.("We are very happy to show you the 🤗 Transformers library.")

Reranking

rerank = Informers.pipeline("reranking")
rerank.("Who created Ruby?", ["Matz created Ruby", "Another doc"])

Named-entity recognition

ner = Transformers.pipeline("ner")
ner.("Ruby is a programming language created by Matz")

Sentiment analysis

classifier = Transformers.pipeline("sentiment-analysis")
classifier.("We are very happy to show you the 🤗 Transformers library.")

Question answering

qa = Transformers.pipeline("question-answering")
qa.(question: "Who invented Ruby?", context: "Ruby is a programming language created by Matz")

Feature extraction

extractor = Transformers.pipeline("feature-extraction")
extractor.("We are very happy to show you the 🤗 Transformers library.")

Vision

Image classification

classifier = Transformers.pipeline("image-classification")
classifier.("image.jpg")

Image feature extraction

extractor = Transformers.pipeline("image-feature-extraction")
extractor.("image.jpg")

API

This library follows the Transformers Python API. The following model architectures are currently supported:

  • BERT
  • DeBERTa-v2
  • DistilBERT
  • MPNet
  • ViT
  • XLM-RoBERTa

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/transformers-ruby.git
cd transformers-ruby
bundle install
bundle exec rake download:files
bundle exec rake test
排名相邻
同类项目