Instructions to use hooman650/bge-large-en-v1.5-onnx-o4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hooman650/bge-large-en-v1.5-onnx-o4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="hooman650/bge-large-en-v1.5-onnx-o4")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("hooman650/bge-large-en-v1.5-onnx-o4") model = AutoModel.from_pretrained("hooman650/bge-large-en-v1.5-onnx-o4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -29,5 +29,8 @@ model.to("cuda")
|
|
| 29 |
pairs = ["pandas usually live in the jungles"]
|
| 30 |
with torch.no_grad():
|
| 31 |
inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=512)
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 33 |
```
|
|
|
|
| 29 |
pairs = ["pandas usually live in the jungles"]
|
| 30 |
with torch.no_grad():
|
| 31 |
inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=512)
|
| 32 |
+
sentence_embeddings = model(**inputs)[0][:, 0]
|
| 33 |
+
|
| 34 |
+
# normalize embeddings
|
| 35 |
+
sentence_embeddings = torch.nn.functional.normalize(sentence_embeddings, p=2, dim=1)
|
| 36 |
```
|