Skip to content

Commit

Permalink
Fix tests expected environment variable name (#2059)
Browse files Browse the repository at this point in the history
* fix env variable name

* fix test

* comment

* load onnx revision
  • Loading branch information
echarlaix authored Oct 15, 2024
1 parent 9fd9ca5 commit d11e285
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_onnxruntime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Test with pytest (in parallel)
env:
FXMARTYCLONE_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
working-directory: tests
run: |
pytest onnxruntime -m "not run_in_series" --durations=0 -vvvv -s -n auto
8 changes: 6 additions & 2 deletions tests/onnxruntime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,13 @@ def test_load_model_from_hub_private(self):
token = os.environ.get("HF_HUB_READ_TOKEN", None)

if token is None:
self.skipTest("Test requires a token for fxmartyclone in the environment variable `HF_HUB_READ_TOKEN`.")
self.skipTest(
"Test requires a read access token for optimum-internal-testing in the environment variable `HF_HUB_READ_TOKEN`."
)

model = ORTModelForCustomTasks.from_pretrained("optimum-internal-testing/tiny-random-phi-private", token=token)
model = ORTModelForCustomTasks.from_pretrained(
"optimum-internal-testing/tiny-random-phi-private", revision="onnx", token=token
)

self.assertIsInstance(model.model, onnxruntime.InferenceSession)
self.assertIsInstance(model.config, PretrainedConfig)
Expand Down

0 comments on commit d11e285

Please sign in to comment.