Download gap-text2sql-main/mrat-sql-gap/data/spider/generate.sh from c4ai-usp/gap-text2sql: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/c4ai-usp/gap-text2sql/resolve/main/gap-text2sql-main/mrat-sql-gap/data/spider/generate.sh
- Command line
-
hf download hf://c4ai-usp/gap-text2sql/gap-text2sql-main/mrat-sql-gap/data/spider/generate.sh
-
curl -L -o generate.sh https://huggingface.co/c4ai-usp/gap-text2sql/resolve/main/gap-text2sql-main/mrat-sql-gap/data/spider/generate.sh
677 Bytes
| if [ "$#" -ne 1 ]; then | |
| echo "Please specify directory containing Spider files." | |
| exit 1 | |
| fi | |
| BASE=$(realpath $(dirname $0)) | |
| # Re-generate 'sql' to fix bad parsing | |
| cp $1/tables.json ${BASE} | |
| for input in train_others train_spider dev; do | |
| echo Procesing $input | |
| cp $1/${input}.json ${BASE} | |
| if [[ -e ${BASE}/${input}.json.patch ]]; then | |
| pushd ${BASE} >& /dev/null | |
| patch < ${input}.json.patch | |
| popd >& /dev/null | |
| fi | |
| python -m seq2struct.datasets.spider_lib.preprocess.parse_raw_json \ | |
| --tables ${BASE}/tables.json \ | |
| --input ${BASE}/${input}.json \ | |
| --output ${BASE}/${input}.json | |
| echo | |
| done | |