Skip to content

Commit 23d4266

Browse files
authored
Revert "Update calls to torch.hub.* to use trust_repo=True. (#281)" (#286)
This reverts commit 5c690fa.
1 parent 5c690fa commit 23d4266

24 files changed

+23
-26
lines changed

datvuthanh_hybridnets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This example loads the pretrained **HybridNets** model and passes an image for i
7777
import torch
7878

7979
# load model
80-
model = torch.hub.load('datvuthanh/hybridnets', 'hybridnets', pretrained=True, trust_repo=True)
80+
model = torch.hub.load('datvuthanh/hybridnets', 'hybridnets', pretrained=True)
8181

8282
#inference
8383
img = torch.randn(1,3,640,384)

huggingface_pytorch-transformers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The tokenizer object allows the conversion from character strings to tokens unde
7171

7272
```py
7373
import torch
74-
tokenizer = torch.hub.load('huggingface/pytorch-transformers', trust_repo=True, 'tokenizer', 'bert-base-uncased') # Download vocabulary from S3 and cache.
74+
tokenizer = torch.hub.load('huggingface/pytorch-transformers', 'tokenizer', 'bert-base-uncased') # Download vocabulary from S3 and cache.
7575
tokenizer = torch.hub.load('huggingface/pytorch-transformers', 'tokenizer', './test/bert_saved_model/') # E.g. tokenizer was saved using `save_pretrained('./test/saved_model/')`
7676
```
7777

hustvl_yolop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This example loads the pretrained **YOLOP** model and passes an image for infere
117117
import torch
118118

119119
# load model
120-
model = torch.hub.load('hustvl/yolop', 'yolop', trust_repo=True, pretrained=True)
120+
model = torch.hub.load('hustvl/yolop', 'yolop', pretrained=True)
121121

122122
#inference
123123
img = torch.randn(1,3,640,640)

intelisl_midas_v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ model_type = "DPT_Large" # MiDaS v3 - Large (highest accuracy, slowest i
4848
#model_type = "DPT_Hybrid" # MiDaS v3 - Hybrid (medium accuracy, medium inference speed)
4949
#model_type = "MiDaS_small" # MiDaS v2.1 - Small (lowest accuracy, highest inference speed)
5050

51-
midas = torch.hub.load("intel-isl/MiDaS", model_type, trust_repo=True)
51+
midas = torch.hub.load("intel-isl/MiDaS", model_type)
5252
```
5353
Move model to GPU if available
5454
```python

mateuszbuda_brain-segmentation-pytorch_unet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/U-NET-for-brain-MRI
1818

1919
```python
2020
import torch
21-
model = torch.hub.load('mateuszbuda/brain-segmentation-pytorch', 'unet', trust_repo=True,
21+
model = torch.hub.load('mateuszbuda/brain-segmentation-pytorch', 'unet',
2222
in_channels=3, out_channels=1, init_features=32, pretrained=True)
2323

2424
```

nicolalandro_ntsnet-cub200_ntsnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/NTSNET
1818

1919
```python
2020
import torch
21-
model = torch.hub.load('nicolalandro/ntsnet-cub200', 'ntsnet', trust_repo=True, pretrained=True,
21+
model = torch.hub.load('nicolalandro/ntsnet-cub200', 'ntsnet', pretrained=True,
2222
**{'topN': 6, 'device':'cpu', 'num_classes': 200})
2323
```
2424

nvidia_deeplearningexamples_efficientnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You can choose among the following models:
6868

6969
There are also quantized version of the models, but they require nvidia container. See [quantized models](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Classification/ConvNets/efficientnet#quantization)
7070
```python
71-
efficientnet = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_efficientnet_b0', trust_repo=True, pretrained=True)
71+
efficientnet = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_efficientnet_b0', pretrained=True)
7272
utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_convnets_processing_utils')
7373

7474
efficientnet.eval().to(device)

nvidia_deeplearningexamples_resnet50.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ print(f'Using {device} for inference')
6161

6262
Load the model pretrained on IMAGENET dataset.
6363
```python
64-
resnet50 = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_resnet50', pretrained=True, trust_repo=True)
64+
resnet50 = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_resnet50', pretrained=True)
6565
utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_convnets_processing_utils')
6666

6767
resnet50.eval().to(device)

nvidia_deeplearningexamples_resnext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ print(f'Using {device} for inference')
6666

6767
Load the model pretrained on IMAGENET dataset.
6868
```python
69-
resneXt = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_resneXt', trust_repo=True)
69+
resneXt = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_resneXt')
7070
utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_convnets_processing_utils')
7171

7272
resneXt.eval().to(device)

nvidia_deeplearningexamples_se-resnext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ print(f'Using {device} for inference')
6666

6767
Load the model pretrained on IMAGENET dataset.
6868
```python
69-
resneXt = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_se_resnext101_32x4d', trust_repo=True)
69+
resneXt = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_se_resnext101_32x4d')
7070
utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_convnets_processing_utils')
7171

7272
resneXt.eval().to(device)

nvidia_deeplearningexamples_ssd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pip install numpy scipy scikit-image matplotlib
5454
Load an SSD model pretrained on COCO dataset, as well as a set of utility methods for convenient and comprehensive formatting of input and output of the model.
5555
```python
5656
import torch
57-
ssd_model = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd', trust_repo=True)
57+
ssd_model = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd')
5858
utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd_processing_utils')
5959
```
6060

nvidia_deeplearningexamples_tacotron2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ apt-get install -y libsndfile1
4343
Load the Tacotron2 model pre-trained on [LJ Speech dataset](https://keithito.com/LJ-Speech-Dataset/) and prepare it for inference:
4444
```python
4545
import torch
46-
tacotron2 = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_tacotron2', trust_repo=True, model_math='fp16')
46+
tacotron2 = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_tacotron2', model_math='fp16')
4747
tacotron2 = tacotron2.to('cuda')
4848
tacotron2.eval()
4949
```

nvidia_deeplearningexamples_waveglow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ apt-get install -y libsndfile1
4141
Load the WaveGlow model pre-trained on [LJ Speech dataset](https://keithito.com/LJ-Speech-Dataset/)
4242
```python
4343
import torch
44-
waveglow = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_waveglow', trust_repo=True, model_math='fp32')
44+
waveglow = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_waveglow', model_math='fp32')
4545
```
4646

4747
Prepare the WaveGlow model for inference

pytorch_vision_ghostnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/GhostNet
1919

2020
```python
2121
import torch
22-
model = torch.hub.load('huawei-noah/ghostnet', 'ghostnet_1x', pretrained=True, trust_repo=True)
22+
model = torch.hub.load('huawei-noah/ghostnet', 'ghostnet_1x', pretrained=True)
2323
model.eval()
2424
```
2525

pytorch_vision_hardnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/HardNet
1919

2020
```python
2121
import torch
22-
model = torch.hub.load('PingoLH/Pytorch-HarDNet', 'hardnet68', pretrained=True, trust_repo=True)
22+
model = torch.hub.load('PingoLH/Pytorch-HarDNet', 'hardnet68', pretrained=True)
2323
# or any of these variants
2424
# model = torch.hub.load('PingoLH/Pytorch-HarDNet', 'hardnet85', pretrained=True)
2525
# model = torch.hub.load('PingoLH/Pytorch-HarDNet', 'hardnet68ds', pretrained=True)

pytorch_vision_ibnnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/IBN-Net
1919

2020
```python
2121
import torch
22-
model = torch.hub.load('XingangPan/IBN-Net', 'resnet50_ibn_a', pretrained=True, trust_repo=True)
22+
model = torch.hub.load('XingangPan/IBN-Net', 'resnet50_ibn_a', pretrained=True)
2323
model.eval()
2424
```
2525

pytorch_vision_meal_v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ We require one additional Python dependency
2727
import torch
2828
# list of models: 'mealv1_resnest50', 'mealv2_resnest50', 'mealv2_resnest50_cutmix', 'mealv2_resnest50_380x380', 'mealv2_mobilenetv3_small_075', 'mealv2_mobilenetv3_small_100', 'mealv2_mobilenet_v3_large_100', 'mealv2_efficientnet_b0'
2929
# load pretrained models, using "mealv2_resnest50_cutmix" as an example
30-
model = torch.hub.load('szq0214/MEAL-V2','meal_v2', 'mealv2_resnest50_cutmix', pretrained=True, trust_repo=True)
30+
model = torch.hub.load('szq0214/MEAL-V2','meal_v2', 'mealv2_resnest50_cutmix', pretrained=True)
3131
model.eval()
3232
```
3333

pytorch_vision_proxylessnas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ demo-model-link: https://huggingface.co/spaces/pytorch/ProxylessNAS
2121
import torch
2222
target_platform = "proxyless_cpu"
2323
# proxyless_gpu, proxyless_mobile, proxyless_mobile14 are also avaliable.
24-
model = torch.hub.load('mit-han-lab/ProxylessNAS', target_platform, pretrained=True, trust_repo=True)
24+
model = torch.hub.load('mit-han-lab/ProxylessNAS', target_platform, pretrained=True)
2525
model.eval()
2626
```
2727

pytorch_vision_resnest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ demo-model-link: https://huggingface.co/spaces/pytorch/ResNeSt
2020
```python
2121
import torch
2222
# get list of models
23-
torch.hub.list('zhanghang1989/ResNeSt', force_reload=True, trust_repo=True)
23+
torch.hub.list('zhanghang1989/ResNeSt', force_reload=True)
2424
# load pretrained models, using ResNeSt-50 as an example
25-
model = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True, trust_repo=True)
25+
model = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True)
2626
model.eval()
2727
```
2828

sigsep_open-unmix-pytorch_umx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pip install -q torchaudio
2626
import torch
2727

2828
# loading umxhq four target separator
29-
separator = torch.hub.load('sigsep/open-unmix-pytorch', 'umxhq', trust_repo=True)
29+
separator = torch.hub.load('sigsep/open-unmix-pytorch', 'umxhq')
3030

3131
# generate random audio
3232
# ... with shape (nb_samples, nb_channels, nb_timesteps)

snakers4_silero-models_stt.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ device = torch.device('cpu') # gpu also works, but our models are fast enough f
3131

3232
model, decoder, utils = torch.hub.load(repo_or_dir='snakers4/silero-models',
3333
model='silero_stt',
34-
trust_repo=True,
3534
language='en', # also available 'de', 'es'
3635
device=device)
3736
(read_batch, split_into_batches,

snakers4_silero-models_tts.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ speaker = 'lj_16khz'
2929
device = torch.device('cpu')
3030
model, symbols, sample_rate, example_text, apply_tts = torch.hub.load(repo_or_dir='snakers4/silero-models',
3131
model='silero_tts',
32-
trust_repo=True,
3332
language=language,
3433
speaker=speaker)
3534
model = model.to(device) # gpu or cpu

snakers4_silero-vad_vad.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ torch.hub.download_url_to_file('https://models.silero.ai/vad_models/en.wav', 'en
3333

3434
model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',
3535
model='silero_vad',
36-
force_reload=True,
37-
trust_repo=True)
36+
force_reload=True)
3837

3938
(get_speech_timestamps,
4039
_, read_audio,

ultralytics_yolov5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This example loads a pretrained **YOLOv5s** model and passes an image for infere
7171
import torch
7272

7373
# Model
74-
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True, trust_repo=True)
74+
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
7575

7676
# Images
7777
imgs = ['https://ultralytics.com/images/zidane.jpg'] # batch of images

0 commit comments

Comments
 (0)