Skip to content

Commit

Permalink
modify model for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Sep 28, 2023
1 parent fc8ce44 commit 4a9729a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ def test_load_from_hub_and_save_model(self):

@parameterized.expand((True, False))
def test_load_from_hub_and_save_decoder_model(self, use_cache):
tokenizer = AutoTokenizer.from_pretrained(self.OV_DECODER_MODEL_ID)
model_id = "vuiseng9/ov-gpt2-fp32-kv-cache" if use_cache else "vuiseng9/ov-gpt2-fp32-no-cache"
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokens = tokenizer("This is a sample input", return_tensors="pt")
loaded_model = OVModelForCausalLM.from_pretrained(self.OV_DECODER_MODEL_ID, use_cache=use_cache)
loaded_model = OVModelForCausalLM.from_pretrained(model_id, use_cache=use_cache)
self.assertIsInstance(loaded_model.config, PretrainedConfig)
loaded_model_outputs = loaded_model(**tokens)

Expand Down

0 comments on commit 4a9729a

Please sign in to comment.