Instructions to use AlgorithmicResearchGroup/arxiv-t5-small-GenQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use AlgorithmicResearchGroup/arxiv-t5-small-GenQ with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("AlgorithmicResearchGroup/arxiv-t5-small-GenQ") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use AlgorithmicResearchGroup/arxiv-t5-small-GenQ with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("AlgorithmicResearchGroup/arxiv-t5-small-GenQ") model = AutoModel.from_pretrained("AlgorithmicResearchGroup/arxiv-t5-small-GenQ") - Notebooks
- Google Colab
- Kaggle
ArtifactAI commited on
Commit ·
354bbf4
1
Parent(s): 320fb39
Update README.md
Browse files
README.md
CHANGED
|
@@ -27,7 +27,7 @@ Then you can use the model like this:
|
|
| 27 |
from sentence_transformers import SentenceTransformer
|
| 28 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 29 |
|
| 30 |
-
model = SentenceTransformer('
|
| 31 |
embeddings = model.encode(sentences)
|
| 32 |
print(embeddings)
|
| 33 |
```
|
|
@@ -53,8 +53,8 @@ def mean_pooling(model_output, attention_mask):
|
|
| 53 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 54 |
|
| 55 |
# Load model from HuggingFace Hub
|
| 56 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 57 |
-
model = AutoModel.from_pretrained('
|
| 58 |
|
| 59 |
# Tokenize sentences
|
| 60 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
|
| 27 |
from sentence_transformers import SentenceTransformer
|
| 28 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 29 |
|
| 30 |
+
model = SentenceTransformer('ArtifactAI/arxiv-t5-small-GenQ')
|
| 31 |
embeddings = model.encode(sentences)
|
| 32 |
print(embeddings)
|
| 33 |
```
|
|
|
|
| 53 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 54 |
|
| 55 |
# Load model from HuggingFace Hub
|
| 56 |
+
tokenizer = AutoTokenizer.from_pretrained('ArtifactAI/arxiv-t5-small-GenQ')
|
| 57 |
+
model = AutoModel.from_pretrained('ArtifactAI/arxiv-t5-small-GenQ')
|
| 58 |
|
| 59 |
# Tokenize sentences
|
| 60 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|