diff options
Diffstat (limited to 'app/client/modules/pix2pixhd/pix2pixhd.tasks.js')
| -rw-r--r-- | app/client/modules/pix2pixhd/pix2pixhd.tasks.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js new file mode 100644 index 0000000..2e7cbbd --- /dev/null +++ b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js @@ -0,0 +1,54 @@ +import uuidv1 from 'uuid/v1' + +import socket from '../../socket' +import types from '../../types' + +import actions from '../../actions' + +import module from './pix2pixhd.module' + +export const fetch_task = (url, file_id, dataset) => dispatch => { + if (! url) return console.log('input file inaccessible (no url)') + const task = { + module: module.name, + activity: 'fetch', + dataset: dataset, + opt: { + url, + file_id, + dataset, + } + } + return actions.queue.add_task(task) +} + +export const train_task = (dataset, folder_id, epochs=1) => dispatch => { + const task = { + module: module.name, + activity: 'train', + dataset: dataset.name, + epoch: 0, + epochs: epochs, + opt: { + folder_id: folder_id, + load_size: 264, // switch to 256 for pix2wav + } + } + console.log(task) + return actions.queue.add_task(task) +} + +export const live_task = (sequence, checkpoint) => dispatch => { + const task = { + module: module.name, + activity: 'live', + dataset: sequence, + checkpoint, + opt: { + poll_delay: 0.09, + } + } + console.log(task) + console.log('add live task') + return actions.queue.add_task(task) +} |
