File size: 447 Bytes
83c2bac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

export CUDA_VISIBLE_DEVICES=0

TSV_FILE="../corpus/wiki_webq_corpus.tsv" # wiki语料库
OUTPUT_FILE="../corpus/ctx_embeddings.pkl" # 语料库embedding
BATCH_SIZE=128
MODEL_NAME="facebook/dpr-ctx_encoder-multiset-base" # 模型
DEVICE="cuda"

python gen_embedding.py \
    --tsv_file $TSV_FILE \
    --output_file $OUTPUT_FILE \
    --batch_size $BATCH_SIZE \
    --model_name $MODEL_NAME \
    --insert_title \
    --device $DEVICE