Skip to content

Commit

Permalink
Update token (#762)
Browse files Browse the repository at this point in the history
* Update token test

* udpate model id
  • Loading branch information
echarlaix authored Jun 11, 2024
1 parent 906668b commit b39eead
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test_openvino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
pip install transformers==${{ matrix.transformers-version }}
pip install .[openvino,openvino-tokenizers,tests,diffusers] onnxruntime
- name: Test with Pytest
env:
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
run: |
pytest tests/openvino/ --ignore tests/openvino/test_modeling_basic.py --durations=0
- name: Test basic
Expand Down
14 changes: 7 additions & 7 deletions tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import gc
import os
import subprocess
import tempfile
import time
import unittest
Expand Down Expand Up @@ -249,13 +248,14 @@ def test_load_from_hub_and_save_stable_diffusion_model(self):
gc.collect()

def test_load_model_from_hub_private_with_token(self):
subprocess.run("huggingface-cli logout", shell=True)
token = os.environ.get("HF_HUB_READ_TOKEN", None)
if token is None:
self.skipTest("Test requires a token `HF_HUB_READ_TOKEN` in the environment variable")

# a fine-grained read-only token of private repo "IlyasMoutawwakil/test-hub-bert"
token = "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"

loaded_model = OVModelForMaskedLM.from_pretrained("IlyasMoutawwakil/test-hub-bert", use_auth_token=token)
self.assertIsInstance(loaded_model.config, PretrainedConfig)
model = OVModelForCausalLM.from_pretrained(
"optimum-internal-testing/tiny-random-phi-private", use_auth_token=token, revision="openvino"
)
self.assertIsInstance(model.config, PretrainedConfig)


class OVModelForSequenceClassificationIntegrationTest(unittest.TestCase):
Expand Down

0 comments on commit b39eead

Please sign in to comment.