Instructions to use markaw/NV-Embed-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use markaw/NV-Embed-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="markaw/NV-Embed-v2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("markaw/NV-Embed-v2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -6,7 +6,7 @@ class EndpointHandler():
|
|
| 6 |
# Preload all the elements you are going to need at inference.
|
| 7 |
# pseudo:
|
| 8 |
# self.model= load_model(path)
|
| 9 |
-
self.embedding_model = SentenceTransformer(
|
| 10 |
|
| 11 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 12 |
"""
|
|
|
|
| 6 |
# Preload all the elements you are going to need at inference.
|
| 7 |
# pseudo:
|
| 8 |
# self.model= load_model(path)
|
| 9 |
+
self.embedding_model = SentenceTransformer("markaw/NV-Embed-v2")
|
| 10 |
|
| 11 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 12 |
"""
|