File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import gc
16
16
import os
17
+ import subprocess
17
18
import tempfile
18
19
import time
19
20
import unittest
@@ -247,6 +248,15 @@ def test_load_from_hub_and_save_stable_diffusion_model(self):
247
248
del pipeline
248
249
gc .collect ()
249
250
251
+ def test_load_model_from_hub_private_with_token (self ):
252
+ subprocess .run ("huggingface-cli logout" , shell = True )
253
+
254
+ # a fine-grained read-only token of private repo "IlyasMoutawwakil/test-hub-bert"
255
+ token = "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"
256
+
257
+ loaded_model = OVModelForMaskedLM .from_pretrained ("IlyasMoutawwakil/test-hub-bert" , use_auth_token = token )
258
+ self .assertIsInstance (loaded_model .config , PretrainedConfig )
259
+
250
260
251
261
class OVModelForSequenceClassificationIntegrationTest (unittest .TestCase ):
252
262
SUPPORTED_ARCHITECTURES = (
You can’t perform that action at this time.
0 commit comments