HKUST-KnowComp / FolkScope

Codes and Datasets for the ACL2023 Findings Paper: FolkScope: Intention Knowledge Graph Construction for Discovering E-commerce Commonsense
MIT License
30 stars 5 forks source link

generation.py: error: the following arguments are required: --behavior_type #2

Closed qige96 closed 1 year ago

qige96 commented 1 year ago

Running the script, reported such error:

(transformers) ricky@myremote:~/codespace/FolkScope$ bash scripts/run_generation.sh
usage: generation.py [-h] --data_dir DATA_DIR --output_dir OUTPUT_DIR
                     --model_name_or_path MODEL_NAME_OR_PATH --model_type
                     MODEL_TYPE --behavior_type BEHAVIOR_TYPE --prompt_type
                     PROMPT_TYPE --generation_type GENERATION_TYPE
                     [--data_cache_name DATA_CACHE_NAME]
                     [--max_seq_length MAX_SEQ_LENGTH]
                     [--max_generation_length MAX_GENERATION_LENGTH]
                     [--temperature TEMPERATURE] [--topp TOPP]
                     [--num_generated_sent NUM_GENERATED_SENT] [--seed SEED]
                     [--batch_size BATCH_SIZE] [--category CATEGORY]
                     [--num_samples NUM_SAMPLES] [--run_index RUN_INDEX]
generation.py: error: the following arguments are required: --behavior_type

Inspecting the code, found:

    parser.add_argument("--behavior_type", default=None, type=str, required=True, help="behavior type: single buy/co-buy/query")

Seems that the program require the option --behavior_type but the script did not provide.

Could you please supply the option you used for your experiments?


BTW, I adapt the script to this:

export TOKENIZERS_PARALLELISM=false

proj_dir=/home/ricky/codespace/FolkScope

CUDA_VISIBLE_DEVICES=0,1 python src/generator/generation.py \
  --data_dir $proj_dir/data \
  --output_dir $proj_dir/output \
  --model_name_or_path gpt2 \
  --model_type gpt2 \
  --max_seq_length 80 \
  --generation_type "inference" \
  --prompt_type "prefix" \
  --max_generation_length 100 \
  --num_generated_sent 3 \
  --batch_size 10 \
  --category "Clothing,-Shoes-&-Jewelry" \
  --num_samples 100 \
  --run_index 0 
ccclyu commented 1 year ago

Thanks! Fixed with new commit.