From 5546fb61abc73834e2343af5ada8617d95f7fdc5 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 2 Aug 2022 19:14:46 +0200 Subject: [PATCH] fix run_clip README (#18332) Co-authored-by: ydshieh --- examples/pytorch/contrastive-image-text/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/pytorch/contrastive-image-text/README.md b/examples/pytorch/contrastive-image-text/README.md index 714fe36761..cfc6a62780 100644 --- a/examples/pytorch/contrastive-image-text/README.md +++ b/examples/pytorch/contrastive-image-text/README.md @@ -43,7 +43,10 @@ cd .. Having downloaded COCO dataset manually you should be able to load with the `ydshieh/coc_dataset_script` dataset loading script: ```py -COCO_DIR = "data" +import os +import datasets + +COCO_DIR = os.path.join(os.getcwd(), "data") ds = datasets.load_dataset("ydshieh/coco_dataset_script", "2017", data_dir=COCO_DIR) ``` @@ -84,7 +87,7 @@ Finally, we can run the example script to train the model: python examples/pytorch/contrastive-image-text/run_clip.py \ --output_dir ./clip-roberta-finetuned \ --model_name_or_path ./clip-roberta \ - --data_dir ./data \ + --data_dir $PWD/data \ --dataset_name ydshieh/coco_dataset_script \ --dataset_config_name=2017 \ --image_column image_path \