Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into skottmckay/FinalizeAn…
Browse files Browse the repository at this point in the history
…droidAzureOpsSupport
  • Loading branch information
skottmckay committed Aug 21, 2023
2 parents 05c8db2 + bdd13d7 commit 9b55386
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/test_autotokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def test_llama_tokenizer(self):
np.testing.assert_array_equal(ids[0], actual_ids)

def test_falcon_tokenizer(self):
# replace the official model name after the model is not gated anymore
tokenizer = AutoTokenizer.from_pretrained("Rocketknight1/falcon-rw-1b", use_fast=False)
text = "why don't you teach me some German?"
ids = tokenizer.encode(text, return_tensors="np")
Expand Down Expand Up @@ -59,6 +58,17 @@ def test_roberta_base(self):

self.assertEqual(OrtPyFunction(m_detok)(ids)[0], tokenizer.decode(ids[0]))

def test_clip_tokenizer(self):
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32", use_fast=False)
text = "Wow, these models are getting popular."
ids = tokenizer.encode(text, return_tensors="np")

ort_tok = OrtPyFunction.from_model(gen_processing_models(
tokenizer,
pre_kwargs={"WITH_DEFAULT_INPUTS": True})[0])
actual_ids = ort_tok([text])[0]
np.testing.assert_array_equal(ids, actual_ids)


if __name__ == '__main__':
unittest.main()

0 comments on commit 9b55386

Please sign in to comment.