Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronymous committed Jan 28, 2024
1 parent 801a13c commit e1fded5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,17 @@ def test_hugging_face_model(self):
)

import tempfile
from transformers import WhisperForConditionalGeneration
from transformers import WhisperForConditionalGeneration, WhisperProcessor, GenerationConfig
tempfolder = os.path.join(tempfile.gettempdir(), "tmp_whisper-tiny-french-cased")

for safe_serialization in False, True,:
for max_shard_size in "100MB", "10GB", :
shutil.rmtree(tempfolder, ignore_errors=True)
model = WhisperForConditionalGeneration.from_pretrained("qanastek/whisper-tiny-french-cased")
processor = WhisperProcessor.from_pretrained("qanastek/whisper-tiny-french-cased")
try:
model.save_pretrained(tempfolder, safe_serialization=safe_serialization, max_shard_size=max_shard_size)
processor.save_pretrained(tempfolder)
self._test_cli_(
["--model", tempfolder, "--verbose", "True"],
"verbose", files=["bonjour.wav"], extensions=None,
Expand Down

0 comments on commit e1fded5

Please sign in to comment.