Skip to content

Commit

Permalink
remove read token
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmarty committed Jun 10, 2024
1 parent 113b645 commit 63bec16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test_onnxruntime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
pytest onnxruntime -m "run_in_series" --durations=0 -vvvv -s
- name: Test with pytest (in parallel)
env:
FXMARTYCLONE_READ_TOKEN: ${{ secrets.FXMARTYCLONE_HUB_READ_TOKEN }}
working-directory: tests
run: |
pytest onnxruntime -m "not run_in_series" --durations=0 -vvvv -s -n auto
9 changes: 6 additions & 3 deletions tests/onnxruntime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,12 @@ def test_stable_diffusion_model_on_rocm_ep_str(self):
self.assertListEqual(model.providers, ["ROCMExecutionProvider", "CPUExecutionProvider"])

def test_load_model_from_hub_private(self):
subprocess.run("huggingface-cli logout", shell=True)
# Read token of fxmartyclone (dummy user).
token = "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"
token = os.environ.get("FXMARTYCLONE_READ_TOKEN", None)

if token is None:
self.skipTest(
"Test requires a token for fxmartyclone in the environment variable `FXMARTYCLONE_READ_TOKEN`."
)

model = ORTModelForCustomTasks.from_pretrained("fxmartyclone/tiny-onnx-private-2", use_auth_token=token)
self.assertIsInstance(model.model, onnxruntime.InferenceSession)
Expand Down

0 comments on commit 63bec16

Please sign in to comment.