ChatBot resurrection of Karl Marx
- Ensure all requirements are installed
pip install -r requirements.txt
- Ensure data is available in working directory:
marx.txt
andmovie.txt
- Run
person.py
for a REPL loop with Marx, or create your own program using the PersonBot class.
- Install requirements
pip install -r requirements.txt
- Import ChatBot from model.py
- Initialize the class MarxBot e.g.
marx = ChatBot(sources=['marx.txt'])
- Call
marx.load('path/to/weights')
- Install requirements
pip install -r requirements.txt
- Import MarxBot from model.py
- Initialize the class MarxBot e.g.
marx = MarxBot(sources=['marx.txt'])
- Call
marx.train()
- Launch GPU EC2 instance with Ubuntu Deep Learning AMI from AWS console
- Ensure to give EC2 IAM write permissions to the s3 bucket to save weights and output to.
- SSH/SCP to instance to copy code across
# Make private key only readable by me
chmod 400 /path/my-key-pair.pem
# SSH into EC2
ssh -i /path/my-key-pair.pem ubuntu@ec2-198-51-100-1.compute-1.amazonaws.com
# Upload files to EC2 using SCP
scp -i /path/my-key-pair.pem /path/SampleFile.txt ubuntu@c2-198-51-100-1.compute-1.amazonaws.com:~
- Double check requirements are installed on the instance by running
pip install -r requirements.txt
- Initialize MarxBot with correct parameters
marx = MarxBot(s3bucket=BUCKETNAME)
- Call
marx.train_online()
, which will train the model and save progress to the s3bucket.
source activate tensorflow_p36