From c98ebc69e69df4d459b63251a7388186bb1148b7 Mon Sep 17 00:00:00 2001 From: xixiaoyao Date: Tue, 26 Nov 2019 16:09:08 +0800 Subject: [PATCH] refactor demos --- demo/demo1/data/mrqa/convert.py | 18 ------------------ demo/demo2/data/mrqa/convert.py | 18 ------------------ demo/demo2/run.sh | 2 +- 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 demo/demo1/data/mrqa/convert.py delete mode 100644 demo/demo2/data/mrqa/convert.py diff --git a/demo/demo1/data/mrqa/convert.py b/demo/demo1/data/mrqa/convert.py deleted file mode 100644 index 1b793a4..0000000 --- a/demo/demo1/data/mrqa/convert.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding: utf-8 -f='mrqa-combined.train.raw.json' -import json -a=json.load(open(f)) -a=a['data'] -writer = open('train.json','w') - -for s in a: - p = s['paragraphs'] - assert len(p) == 1 - p = p[0] - q = {} - q['context'] = p['context'] - q['qa_list'] = p['qas'] - writer.write(json.dumps(q)+'\n') - -writer.close() - diff --git a/demo/demo2/data/mrqa/convert.py b/demo/demo2/data/mrqa/convert.py deleted file mode 100644 index 1b793a4..0000000 --- a/demo/demo2/data/mrqa/convert.py +++ /dev/null @@ -1,18 +0,0 @@ -# coding: utf-8 -f='mrqa-combined.train.raw.json' -import json -a=json.load(open(f)) -a=a['data'] -writer = open('train.json','w') - -for s in a: - p = s['paragraphs'] - assert len(p) == 1 - p = p[0] - q = {} - q['context'] = p['context'] - q['qa_list'] = p['qas'] - writer.write(json.dumps(q)+'\n') - -writer.close() - diff --git a/demo/demo2/run.sh b/demo/demo2/run.sh index 5d0a5a0..9e75bc7 100755 --- a/demo/demo2/run.sh +++ b/demo/demo2/run.sh @@ -1,3 +1,3 @@ -export CUDA_VISIBLE_DEVICES=0,1 +export CUDA_VISIBLE_DEVICES=0 python run.py -- GitLab