Skip to content

Commit

Permalink
modified .sh scripts and made shell directory to store
Browse files Browse the repository at this point in the history
  • Loading branch information
wangmagg committed May 6, 2021
1 parent bf245b6 commit 5a0aba8
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 4 deletions.
18 changes: 18 additions & 0 deletions shell/generate-py.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# Python-based generation
#
# usage: ./generate.sh experiment-name path-to-files decoders model-name sample-length
# example usage: ./generate.sh umtcpc-pretrained-wavenet results/05_05_21/umtcpc_pretrained_wavenet-py "0 1 2" umtcpc 80000

#!/usr/bin/env bash

DATE=`date +%d_%m_%Y`
CODE=src

python3.7 ${CODE}/data/run_on_files.py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --files $2 --decoders $3 --model-name $4 --sample-len $5 --sample-len 80000 --py

18 changes: 18 additions & 0 deletions shell/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# Generate with nvidia wavenet kernels
#
# usage: ./generate.sh experiment-name path-to-files decoders model-name
# example usage: ./generate.sh umtcpc-pretrained-wavenet results/05_05_21/umtcpc_pretrained_wavenet "0 1 2" umtcpc

#!/usr/bin/env bash

DATE=`date +%d_%m_%Y`
CODE=src

python3.7 ${CODE}/data/run_on_files.py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --files $2 --decoders $3 --model-name $4 --sample-len 80000

4 changes: 2 additions & 2 deletions inference.sh → shell/inference-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ DATE=`date +%d_%m_%Y`
CODE=src
OUTPUT=results/${DATE}/$1

python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT}-py -n 2 --seq 80000 \
--files ${OUTPUT}-py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --py --sample
python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT}-py -n 2 \
--files ${OUTPUT}-py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --sample-len 80000 --py

15 changes: 15 additions & 0 deletions shell/inference.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#!/usr/bin/env bash

DATE=`date +%d_%m_%Y`
CODE=src
OUTPUT=results/${DATE}/$1

python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT} -n 2 \
--files ${OUTPUT} --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --sample-len 80000

File renamed without changes.
19 changes: 19 additions & 0 deletions shell/sample-pretrained-umt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#!/usr/bin/env bash

DATE=`date +%d_%m_%Y`
CODE=src
OUTPUT=results/${DATE}/$1

python3.7 ${CODE}/data/data_samples.py \
--data data/musicnet/preprocessed/Solo_Cello \
data/musicnet/preprocessed/Solo_Violin \
data/musicnet/preprocessed/Beethoven_Solo_Piano \
--output-sampled ${OUTPUT} -n 2

echo "Finished writing samples to ${OUTPUT}"
15 changes: 15 additions & 0 deletions shell/sample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#!/usr/bin/env bash

DATE=`date +%d_%m_%Y`
CODE=src
OUTPUT=results/${DATE}/$1

python3.7 ${CODE}/data/data_samples.py --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT} -n 2

echo "Finished writing samples to ${OUTPUT}"
File renamed without changes.
2 changes: 1 addition & 1 deletion src/data/data_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main():
help='Path to data dir')
parser.add_argument('--data-from-args', type=Path,
help='Path to args.pth')
parser.add_argument('--output', '-o', type=Path,
parser.add_argument('--output-sampled', '-os', type=Path,
help='Output path')
parser.add_argument('-n', type=int,
help='Num samples to make')
Expand Down
1 change: 0 additions & 1 deletion src/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pathlib import Path

parser = argparse.ArgumentParser()
parser.add_argument('--sample', action='store_true', help='Create data samples as inpu')

# For sampling
parser.add_argument('--data', type=Path, nargs='*',
Expand Down

0 comments on commit 5a0aba8

Please sign in to comment.