Embeddings: HF model hub support added via transformers (#1154)

This commit is contained in:
Raghav Dixit
2024-04-05 00:26:27 -04:00
committed by Weston Pace
parent ac63d4066b
commit 1c41a00d87
6 changed files with 136 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ except Exception:
@pytest.mark.slow
@pytest.mark.parametrize("alias", ["sentence-transformers", "openai"])
@pytest.mark.parametrize("alias", ["sentence-transformers", "openai", "huggingface"])
def test_basic_text_embeddings(alias, tmp_path):
db = lancedb.connect(tmp_path)
registry = get_registry()
@@ -84,7 +84,7 @@ def test_basic_text_embeddings(alias, tmp_path):
)
)
query = "greetings"
query = "greeting"
actual = (
table.search(query, vector_column_name="vector").limit(1).to_pydantic(Words)[0]
)
@@ -184,9 +184,9 @@ def test_imagebind(tmp_path):
import shutil
import tempfile
import lancedb.embeddings.imagebind
import pandas as pd
import requests
from lancedb.embeddings import get_registry
from lancedb.pydantic import LanceModel, Vector
@@ -321,8 +321,6 @@ def test_gemini_embedding(tmp_path):
)
@pytest.mark.slow
def test_gte_embedding(tmp_path):
import lancedb.embeddings.gte
model = get_registry().get("gte-text").create()
class TextModel(LanceModel):