This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gssh() { | |
| gcloud compute ssh $@ | |
| } | |
| gssh $INSTANCE_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ginstance_stop() { | |
| gcloud compute instances stop - quiet $@ | |
| } | |
| ginstance_stop $INSTANCE_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export IMAGE_NAME="my-awesome-image" | |
| export IMAGE_FAMILY="family1" | |
| gcloud compute images create $IMAGE_NAME \ | |
| --source-disk $INSTANCE_NAME \ | |
| --source-disk-zone $ZONE \ | |
| --family $IMAGE_FAMILY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gssh $INSTANCE_NAME -- -L 8080:localhost:8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export IMAGE_FAMILY="tf-latest-cu92" | |
| export ZONE="us-west1-b" | |
| export INSTANCE_NAME="chat-bot-trainer" | |
| gcloud compute instances create $INSTANCE_NAME \ | |
| --zone=$ZONE \ | |
| --image-family=$IMAGE_FAMILY \ | |
| --image-project=deeplearning-platform-release \ | |
| --maintenance-policy=TERMINATE \ | |
| --accelerator='type=nvidia-tesla-v100,count=1' \ | |
| --metadata='install-nvidia-driver=True' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget https://gist.github.com/b0noI/9c6ff272c813dab5f4a4869597771007/raw/5185a23cd061cef12bb9524527f1cdc71faf3a9f/nltk_prep.py | |
| python nltk_prep.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Dialog convertor | |
| git clone https://github.com/b0noI/dialog_converter.git | |
| cd dialog_converter | |
| git checkout b9cc7b7d82a959c80e5048b18e956841233c7688 | |
| python3 ./converter.py | |
| cd .. | |
| # Subwork NMT | |
| git clone https://github.com/b0noI/subword-nmt.git | |
| cd subword-nmt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget https://gist.githubusercontent.com/b0noI/174959e2056702e64a5ca39853a9816d/raw/d90f6c97433a2e53778f64d5722ab99577c42fda/train_chatbot.sh | |
| bash train_chatbot.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| cd nmt | |
| touch ~/content/output | |
| chat () { | |
| echo $1 > ~/content/input | |
| python3 $HOME/pre_processing.py ~/content/input >~/content/input.pre | |
| $HOME/subword-nmt/apply_bpe.py -c $HOME/code.bpe --vocabulary $HOME/vocab.train.bpe.a --vocabulary-threshold 5 < ~/content/input.pre > `/content/input.pre.bpe | |
| cd $HOME/nmt | |
| python -m nmt.nmt --out_dir=~/content/nmt_model --inference_input_file=~/content/input.pre.bpe --inference_output_file=~/content/output > /dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gcloud compute images describe-from-family tf-latest-cu92 --project=deeplearning-platform-release --format "value(name)" |