Skip to content

Commit

Permalink
Update test_models_initialization.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBLACK11 authored Nov 9, 2023
1 parent 99ebbfd commit 6356c4d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions laser_encoders/test_models_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def test_validate_kashmiri_models_and_tokenize_laser3(lang="kas"):
print(f"Created temporary directory for {lang}", tmp_dir)

downloader = LaserModelDownloader(model_dir=tmp_dir)
downloader.download_laser3(lang)

encoder = initialize_encoder(lang, model_dir=tmp_dir)
tokenizer = initialize_tokenizer(lang, model_dir=tmp_dir)

# Test tokenization with a sample sentence
tokenized = tokenizer.tokenize("This is a sample sentence.")
with pytest.raises(ValueError):
downloader.download_laser3(lang)

encoder = initialize_encoder(lang, model_dir=tmp_dir)
tokenizer = initialize_tokenizer(lang, model_dir=tmp_dir)

# Test tokenization with a sample sentence
tokenized = tokenizer.tokenize("This is a sample sentence.")

print(f"{lang} model validated successfully")

0 comments on commit 6356c4d

Please sign in to comment.