Automatically download converted models from the Hugging Face Hub (#70)
* Automatically download converted models from the Hugging Face Hub * Remove unused import * Remove non needed requirements in dev mode * Remove extra index URL when pip install in CI * Allow downloading to a specific directory * Update docstring * Add argument to disable the progess bars * Fix typo in docstring
This commit is contained in:
17
tests/test_utils.py
Normal file
17
tests/test_utils.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
|
||||
from faster_whisper import download_model
|
||||
|
||||
|
||||
def test_download_model(tmpdir):
|
||||
output_dir = str(tmpdir.join("model"))
|
||||
|
||||
model_dir = download_model("tiny", output_dir=output_dir)
|
||||
|
||||
assert model_dir == output_dir
|
||||
assert os.path.isdir(model_dir)
|
||||
assert not os.path.islink(model_dir)
|
||||
|
||||
for filename in os.listdir(model_dir):
|
||||
path = os.path.join(model_dir, filename)
|
||||
assert not os.path.islink(path)
|
||||
Reference in New Issue
Block a user