2018-03-10 00:07:56 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
require 'date'
|
|
|
|
|
|
|
|
models_dir = 'models'
|
2018-03-14 10:06:55 +00:00
|
|
|
model_name = (ARGV[0] or "default")
|
2018-03-10 00:07:56 +00:00
|
|
|
model_path = File.join(models_dir, model_name)
|
|
|
|
|
2018-03-14 10:06:55 +00:00
|
|
|
episode_count = (File.read File.join(model_path, 'episodes_trained')).to_i
|
2018-03-10 00:07:56 +00:00
|
|
|
|
|
|
|
puts "Found model #{model_name} with episodes #{episode_count} trained!"
|
|
|
|
|
|
|
|
file_name = "model-#{model_name}-#{episode_count}-#{Time.now.strftime('%Y%m%d-%H%M%S')}.tar.gz"
|
|
|
|
save_path = File.join(models_dir, 'saves', file_name)
|
|
|
|
puts "Saving to #{save_path}"
|
|
|
|
|
|
|
|
`tar -cvzf #{save_path} -C #{models_dir} #{model_name}`
|