summaryrefslogtreecommitdiff
path: root/app/client/modules
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/modules')
-rw-r--r--app/client/modules/pix2pixhd/pix2pixhd.tasks.js6
-rw-r--r--app/client/modules/pix2pixhd/views/pix2pixhd.train.js19
2 files changed, 21 insertions, 4 deletions
diff --git a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js
index bd51f2b..412f066 100644
--- a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js
+++ b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js
@@ -26,13 +26,17 @@ export const train_task = (dataset, folder_id, epochs=1) => dispatch => {
const task = {
module: module.name,
activity: 'train',
- dataset: dataset.name,
+ dataset: dataset.name || dataset,
epoch: 0,
epochs: epochs,
opt: {
folder_id: folder_id,
}
}
+ if (!task.dataset) {
+ console.error("train task: no dataset specified")
+ return
+ }
console.log(task)
return actions.queue.add_task(task)
}
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js
index ace93e4..b029eab 100644
--- a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js
+++ b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js
@@ -64,6 +64,10 @@ class Pix2PixHDTrain extends Component {
console.log('name', name, 'value', value)
this.setState({ [name]: value })
}
+ interrupt(){
+ this.props.actions.queue.stop_task('gpu')
+ }
+
render(){
if (this.props.pix2pixhd.loading) {
return <Loading progress={this.props.pix2pixhd.progress} />
@@ -89,9 +93,9 @@ class Pix2PixHDTrain extends Component {
}
}).filter(n => !!n && !!n.options.length).sort((a,b) => a.name.localeCompare(b.name))
- console.log('state', this.props.pix2pixhd.data.epochs)
+ // console.log('state', this.props.pix2pixhd.data.epochs)
// console.log(this.state.checkpoint_name, this.state.epoch)
-
+ console.log(queue)
return (
<div className='app pix2pixhd'>
<div class='heading'>
@@ -160,12 +164,20 @@ class Pix2PixHDTrain extends Component {
onClick={() => this.props.remote.clear_recursive_task(this.state.checkpoint_name)}
/>
</Group>
+
+ <Group title='Status'>
+ <Button
+ title="GPU"
+ value={this.props.runner.gpu.status === 'IDLE' ? "Idle" : "Interrupt"}
+ onClick={() => this.interrupt()}
+ />
+ </Group>
</div>
<div>
<CurrentTask />
{!!queue.queue.length &&
<Group title='Upcoming Tasks'>
- <TaskList tasks={queue.queue.map(id => queue.tasks[id])} />
+ <TaskList tasks={queue.queue.map(id => queue.tasks[id])} sort="date asc" />
</Group>
}
</div>
@@ -176,6 +188,7 @@ class Pix2PixHDTrain extends Component {
const mapStateToProps = state => ({
pix2pixhd: state.module.pix2pixhd,
+ runner: state.system.runner,
queue: state.queue,
})