question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

is sentence-bert available on tensorflow?

See original GitHub issue

Hello and thanks for this amazing package.

This might be a very naive question, but is there a port of sentence-transformers to tensorflow? Indeed, all my code is in tensorflow (not pytorch) and I would like to use your package.

What do you think? Thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nreimerscommented, Aug 23, 2021

Code should be something like this:

from transformers import TFAutoModel
model = TFAutoModel.from_pretrained("model_name", from_pt=True)
model.save_pretrained("your/folder")

For this you need Pytorch and TF installed. After that, you can load the model from your/folder without pytorch.

2reactions
nreimerscommented, Aug 23, 2021

Not yet. But all models are on the hub: https://huggingface.co/sentence-transformers

Converting them to tensorflow is easy and then you need to implement the pooling operation in tensorflow. Should be done in about half an hour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Universal Sentence Encoder | TensorFlow Hub
This notebook illustrates how to access the Universal Sentence Encoder and use it for sentence similarity and sentence classification tasks.
Read more >
SentenceTransformers Documentation — Sentence ...
SentenceTransformers is a Python framework for state-of-the-art sentence, text and image embeddings. The initial work is described in our paper Sentence-BERT: ...
Read more >
Sentence Transformers - Hugging Face
SentenceTransformers is a Python framework for state-of-the-art sentence, text and image embeddings. Install the Sentence Transformers library. pip install - ...
Read more >
spacy-universal-sentence-encoder - PyPI
This library lets you embed Docs, Spans and Tokens from the Universal Sentence Encoder family available on TensorFlow Hub. For using sentence-BERT in...
Read more >
How to get sentence embedding using BERT?
Is it hidden_reps or cls_head ? Is there any other way to get sentence embedding from BERT in order to perform similarity check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found