File size: 1,521 Bytes
6fe7180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#SBATCH --partition=main                                 # Ask for unkillable job
#SBATCH --gres=gpu:1
#SBATCH --mem=10G                                        # Ask for 10 GB of RAM
#SBATCH --time=2:00:00                                   # The job will run for 3 hours
#SBATCH --output=./logs/abstractive_out.txt
#SBATCH --error=./logs/abstractive_error.txt
#SBATCH -c 2


# Load the required modules
module --quiet load miniconda/3
module --quiet load cuda/12.1.1
conda activate "glimpse"

# Check if input file path is provided and valid
if [ -z "$1" ] || [ ! -f "$1" ]; then
    # if no path is provided, or the path is invalid, use the default test dataset
    echo "Couldn't find a valid path. Using default path: data/processed/all_reviews_2017.csv"
    dataset_path="data/processed/all_reviews_2017.csv"
else
    dataset_path="$1"
fi


# Generate abstractive summaries
if [[ "$@" =~ "--add-padding" ]]; then # check if padding argument is present
    # add '--no-trimming' flag to the script
    candidates=$(python glimpse/data_loading/generate_abstractive_candidates.py  --dataset_path "$dataset_path" --scripted-run --no-trimming | tail -n 1)
else
    # no additional flags
    candidates=$(python glimpse/data_loading/generate_abstractive_candidates.py --dataset_path "$dataset_path" --scripted-run | tail -n 1)
fi


# Compute the RSA scores based on the generated summaries
rsa_scores=$(python glimpse/src/compute_rsa.py --summaries $candidates | tail -n 1)