This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Shell and python file to only download image chat data. 2. Updated… (
#2381) * 1. Shell and python file to only download image chat data. 2. Updated readme * Adding Copyright * incorporating pylint suggestions * running autoformat.sh * related to #2381. rolling back after autoformat * lint suggestions * lint suggestions
- Loading branch information
1 parent
5e9f9f6
commit 917baab
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import argparse | ||
from parlai.tasks.image_chat.build import build | ||
|
||
|
||
def parse_args(): | ||
""" | ||
Wrapper to parse CLI arguments. | ||
:return: args | ||
""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"-dp", "--datapath", default="/tmp", help="Path where to save data." | ||
) | ||
|
||
args = parser.parse_args() | ||
# opts is dic in parlai | ||
args = vars(args) | ||
|
||
return args | ||
|
||
|
||
if __name__ == "__main__": | ||
opt = parse_args() | ||
# Only datapath is required by build. | ||
# Using build function to check the version and | ||
# internal hash | ||
build(opt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
export CURRENT_DIR=${PWD} | ||
# Should return the ParlAI clone path | ||
echo "Running code from: " $CURRENT_DIR | ||
|
||
export DATA_DIR=/tmp/ | ||
mkdir -p $DATA_DIR | ||
echo "Downloading in data root: " $DATA_DIR | ||
|
||
PYTHONPATH=. python parlai/tasks/image_chat/download_data.py \ | ||
-dp $DATA_DIR |