-
Notifications
You must be signed in to change notification settings - Fork 979
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
7820952
commit 731efd7
Showing
2 changed files
with
125 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import pytest | ||
|
||
from buzz.model_loader import ModelDownloader,TranscriptionModel, ModelType, WhisperModelSize | ||
|
||
|
||
class TestModelLoader: | ||
@pytest.mark.parametrize( | ||
"model", | ||
[ | ||
TranscriptionModel( | ||
model_type=ModelType.HUGGING_FACE, | ||
hugging_face_model_id="RaivisDejus/whisper-tiny-lv", | ||
), | ||
], | ||
) | ||
def test_download_model(self, model: TranscriptionModel): | ||
model_loader = ModelDownloader(model=model) | ||
model_loader.run() | ||
|
||
model_path = model.get_local_model_path() | ||
|
||
assert model_path is not None, "Model path is None" | ||
assert os.path.isdir(model_path), "Model path is not a directory" | ||
assert len(os.listdir(model_path)) > 0, "Model directory is empty" |