From 06a925c32b49fd0455e265097fa7ca623cec4154 Mon Sep 17 00:00:00 2001 From: GdoongMathew Date: Mon, 13 Jan 2025 18:37:55 +0800 Subject: [PATCH] fix: fix code block rendering problem in `Using models from Hub` (#8846) --- docs/source/models.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/models.rst b/docs/source/models.rst index 53e8d87609e..d0096aaf854 100644 --- a/docs/source/models.rst +++ b/docs/source/models.rst @@ -172,7 +172,11 @@ Most pre-trained models can be accessed directly via PyTorch Hub without having model = torch.hub.load("pytorch/vision", "resnet50", weights="IMAGENET1K_V2") # Option 2: passing weights param as enum - weights = torch.hub.load("pytorch/vision", "get_weight", weights="ResNet50_Weights.IMAGENET1K_V2") + weights = torch.hub.load( + "pytorch/vision", + "get_weight", + weights="ResNet50_Weights.IMAGENET1K_V2", + ) model = torch.hub.load("pytorch/vision", "resnet50", weights=weights) You can also retrieve all the available weights of a specific model via PyTorch Hub by doing: