-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b26cf34
commit 41284e9
Showing
3 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Generator | ||
|
||
import pytest | ||
from colpali_engine.models import ColQwen2 | ||
from colpali_engine.utils.torch_utils import get_torch_device, tear_down_torch | ||
|
||
from byaldi import RAGMultiModalModel | ||
from byaldi.colpali import ColPaliModel | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def colqwen_rag_model() -> Generator[RAGMultiModalModel, None, None]: | ||
device = get_torch_device("auto") | ||
print(f"Using device: {device}") | ||
yield RAGMultiModalModel.from_pretrained("vidore/colqwen2-v0.1", device=device) | ||
tear_down_torch() | ||
|
||
|
||
@pytest.mark.slow | ||
def test_load_colqwen_from_pretrained(colqwen_rag_model: RAGMultiModalModel): | ||
assert isinstance(colqwen_rag_model, RAGMultiModalModel) | ||
assert isinstance(colqwen_rag_model.model, ColPaliModel) | ||
assert isinstance(colqwen_rag_model.model.model, ColQwen2) |