From 8feede229cc801485fff1e4db28a432a2e9aebb4 Mon Sep 17 00:00:00 2001 From: Shotaro Ishihara Date: Thu, 10 Mar 2022 01:07:52 +0900 Subject: [PATCH] Fix broken code blocks in README.md (#15967) at transformers/examples/pytorch/contrastive-image-text --- examples/pytorch/contrastive-image-text/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/pytorch/contrastive-image-text/README.md b/examples/pytorch/contrastive-image-text/README.md index 969cc56a2d..714fe36761 100644 --- a/examples/pytorch/contrastive-image-text/README.md +++ b/examples/pytorch/contrastive-image-text/README.md @@ -39,13 +39,14 @@ wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip wget http://images.cocodataset.org/annotations/image_info_test2017.zip cd .. ``` -```suggestion Having downloaded COCO dataset manually you should be able to load with the `ydshieh/coc_dataset_script` dataset loading script: ```py COCO_DIR = "data" ds = datasets.load_dataset("ydshieh/coco_dataset_script", "2017", data_dir=COCO_DIR) +``` + ### Create a model from a vision encoder model and a text decoder model Next, we create a [VisionTextDualEncoderModel](https://huggingface.co/docs/transformers/model_doc/vision-text-dual-encoder#visiontextdualencoder). The `VisionTextDualEncoderModel` class let's you load any vision and text encoder model to create a dual encoder. @@ -95,4 +96,4 @@ python examples/pytorch/contrastive-image-text/run_clip.py \ --learning_rate="5e-5" --warmup_steps="0" --weight_decay 0.1 \ --overwrite_output_dir \ --push_to_hub -``` \ No newline at end of file +```