Skip to content

Commit 535b1ff

Browse files
committed
Allow downloading models from huggingface during tests
1 parent 64fb8ae commit 535b1ff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_trainer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
44
# You can obtain one at http://mozilla.org/MPL/2.0/.
55

6+
import re
7+
68
import responses
79

810
from bugbug import bugzilla, db
@@ -34,6 +36,8 @@ def test_trainer_simple():
3436

3537
# Test finetuning of transformer model
3638
def test_trainer_finetuning():
39+
responses.add_passthru(re.compile(r"https://.*\.?huggingface.co/\w+"))
40+
3741
# Pretend the DB was already downloaded and no new DB is available.
3842

3943
url = "https://community-tc.services.mozilla.com/api/index/v1/task/project.bugbug.data_bugs.latest/artifacts/public/bugs.json"
@@ -57,6 +61,8 @@ def test_trainer_finetuning():
5761

5862
# Test xgboost model on transformed model's embeddings
5963
def test_trainer_embedding():
64+
responses.add_passthru(re.compile(r"https://.*\.?huggingface.co/\w+"))
65+
6066
# Pretend the DB was already downloaded and no new DB is available.
6167

6268
url = "https://community-tc.services.mozilla.com/api/index/v1/task/project.bugbug.data_bugs.latest/artifacts/public/bugs.json"

0 commit comments

Comments
 (0)