Feature Extraction
Transformers
Safetensors
English
Korean
multilingual
qwen3_vl
vision-language
embedding
multimodal-embedding
mmeb
digital-forensics
custom_code
Instructions to use Urock-AI/Eddy-vl_embedding_1.9B_v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Urock-AI/Eddy-vl_embedding_1.9B_v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Urock-AI/Eddy-vl_embedding_1.9B_v1", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("Urock-AI/Eddy-vl_embedding_1.9B_v1", trust_remote_code=True) model = AutoModel.from_pretrained("Urock-AI/Eddy-vl_embedding_1.9B_v1", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Simplify README usage section
Browse files
README.md
CHANGED
|
@@ -83,38 +83,20 @@ from PIL import Image
|
|
| 83 |
from vl_embedding_v1 import VLEmbedder
|
| 84 |
|
| 85 |
model_id = "Urock-AI/Eddy-vl_embedding_1.9B_v1"
|
|
|
|
| 86 |
|
| 87 |
-
embedder = VLEmbedder(
|
| 88 |
-
model_id,
|
| 89 |
-
torch_dtype=torch.bfloat16,
|
| 90 |
-
default_instruction="Represent this input for retrieval.",
|
| 91 |
-
)
|
| 92 |
|
| 93 |
-
#
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
> `trust_remote_code=True` is required for `processing_vl.py` (`VLProcessor`) in this repo. Model weights load from `model.safetensors`.
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
```python
|
| 102 |
-
INSTRUCTION = "Represent this input for retrieval."
|
| 103 |
-
|
| 104 |
-
query = embedder.process(
|
| 105 |
-
[{"text": "a tan toilet and sink in a small room", "instruction": INSTRUCTION}],
|
| 106 |
-
)[0]
|
| 107 |
-
candidates = [
|
| 108 |
-
embedder.process([{"image": Image.open(p), "instruction": INSTRUCTION}])[0]
|
| 109 |
-
for p in ["a.jpg", "b.jpg", "c.jpg"]
|
| 110 |
-
]
|
| 111 |
-
|
| 112 |
-
scores = [(query @ c.T).item() for c in candidates]
|
| 113 |
-
ranking = sorted(range(len(scores)), key=lambda i: scores[i], reverse=True)
|
| 114 |
-
print(ranking, scores)
|
| 115 |
```
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
---
|
| 120 |
|
|
|
|
| 83 |
from vl_embedding_v1 import VLEmbedder
|
| 84 |
|
| 85 |
model_id = "Urock-AI/Eddy-vl_embedding_1.9B_v1"
|
| 86 |
+
instruction = "Represent this input for retrieval."
|
| 87 |
|
| 88 |
+
embedder = VLEmbedder(model_id, torch_dtype=torch.bfloat16, default_instruction=instruction)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
+
# text / image / video → 2048-d vectors (L2-normalized)
|
| 91 |
+
text_vec = embedder.process([{"text": "a photo of a cat"}])[0]
|
| 92 |
+
image_vec = embedder.process([{"image": Image.open("photo.jpg")}])[0]
|
| 93 |
+
video_vec = embedder.process([{"video": "clip.mp4"}])[0]
|
|
|
|
| 94 |
|
| 95 |
+
# cosine similarity = dot product
|
| 96 |
+
score = (text_vec @ image_vec.T).item()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
```
|
| 98 |
|
| 99 |
+
> `trust_remote_code=True` is required for `processing_vl.py` (`VLProcessor`) in this repo.
|
| 100 |
|
| 101 |
---
|
| 102 |
|