Skip to content
Snippets Groups Projects
Unverified Commit b0eb587b authored by James Briggs's avatar James Briggs
Browse files

fix: force download of HF models in tests

parent 04c57b32
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,6 @@ jobs: ...@@ -21,8 +21,6 @@ jobs:
# - "3.12" # - "3.12"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Git
run: sudo apt-get install git
- name: Cache Poetry - name: Cache Poetry
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
......
...@@ -4,8 +4,14 @@ import torch ...@@ -4,8 +4,14 @@ import torch
from PIL import Image from PIL import Image
from semantic_router.encoders import CLIPEncoder from semantic_router.encoders import CLIPEncoder
from transformers import AutoTokenizer, AutoModel
test_model_name = "aurelio-ai/sr-test-clip" test_model_name = "aurelio-ai/sr-test-clip"
# force the model download
tokenizer = AutoTokenizer.from_pretrained(test_model_name, force_download=True)
model = AutoModel.from_pretrained(test_model_name, force_download=True)
clip_encoder = CLIPEncoder(name=test_model_name) clip_encoder = CLIPEncoder(name=test_model_name)
embed_dim = 64 embed_dim = 64
......
...@@ -4,8 +4,14 @@ import numpy as np ...@@ -4,8 +4,14 @@ import numpy as np
import pytest import pytest
from semantic_router.encoders.huggingface import HuggingFaceEncoder from semantic_router.encoders.huggingface import HuggingFaceEncoder
from transformers import AutoTokenizer, AutoModel
test_model_name = "aurelio-ai/sr-test-huggingface" test_model_name = "aurelio-ai/sr-test-huggingface"
# force the model download
tokenizer = AutoTokenizer.from_pretrained(test_model_name, force_download=True)
model = AutoModel.from_pretrained(test_model_name, force_download=True)
encoder = HuggingFaceEncoder(name=test_model_name) encoder = HuggingFaceEncoder(name=test_model_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment