@@ -7,6 +7,8 @@ import InlineHelpChat from "./InlineHelpChat";
77function InputSelector ( props ) {
88 const context = useContext ( AppContext ) ;
99 const { type } = props ;
10+ const workflow =
11+ type === "training" ? context . trainingState : context . inferenceState ;
1012
1113 const projectContext =
1214 "Biomedical image segmentation using PyTorch Connectomics." ;
@@ -16,25 +18,25 @@ function InputSelector(props) {
1618 : "Model inference configuration — Step 1: Set Inputs." ;
1719
1820 const handleLogPathChange = ( value ) => {
19- context . setLogPath ( value ) ;
21+ workflow . setLogPath ( value ) ;
2022 } ;
2123
2224 const handleOutputPathChange = ( value ) => {
23- context . setOutputPath ( value ) ;
25+ workflow . setOutputPath ( value ) ;
2426 } ;
2527
2628 const handleCheckpointPathChange = ( value ) => {
27- context . setCheckpointPath ( value ) ;
29+ workflow . setCheckpointPath ( value ) ;
2830 } ;
2931
3032 const handleImageChange = ( value ) => {
3133 console . log ( `selected image:` , value ) ;
32- context . setInputImage ( value ) ;
34+ workflow . setInputImage ( value ) ;
3335 } ;
3436
3537 const handleLabelChange = ( value ) => {
3638 console . log ( `selected label:` , value ) ;
37- context . setInputLabel ( value ) ;
39+ workflow . setInputLabel ( value ) ;
3840 } ;
3941
4042 // Helper to get value for UnifiedFileInput (can be object or string)
@@ -61,7 +63,7 @@ function InputSelector(props) {
6163 taskKey = { type }
6264 label = "Input Image"
6365 yamlKey = "DATASET.INPUT_PATH"
64- value = { context . inputImage }
66+ value = { workflow . inputImage }
6567 projectContext = { projectContext }
6668 taskContext = { taskContext }
6769 />
@@ -71,7 +73,7 @@ function InputSelector(props) {
7173 < UnifiedFileInput
7274 placeholder = "Please select or input image path"
7375 onChange = { handleImageChange }
74- value = { getValue ( context . inputImage ) }
76+ value = { getValue ( workflow . inputImage ) }
7577 selectionType = {
7678 type === "training" || type === "inference"
7779 ? "fileOrDirectory"
@@ -82,12 +84,14 @@ function InputSelector(props) {
8284 < Form . Item
8385 label = {
8486 < Space align = "center" >
85- < span > Input Label</ span >
87+ < span >
88+ { type === "training" ? "Input Label" : "Input Label (Optional)" }
89+ </ span >
8690 < InlineHelpChat
8791 taskKey = { type }
8892 label = "Input Label"
8993 yamlKey = "DATASET.LABEL_NAME"
90- value = { context . inputLabel }
94+ value = { workflow . inputLabel }
9195 projectContext = { projectContext }
9296 taskContext = { taskContext }
9397 />
@@ -97,7 +101,7 @@ function InputSelector(props) {
97101 < UnifiedFileInput
98102 placeholder = "Please select or input label path"
99103 onChange = { handleLabelChange }
100- value = { getValue ( context . inputLabel ) }
104+ value = { getValue ( workflow . inputLabel ) }
101105 selectionType = {
102106 type === "training" || type === "inference"
103107 ? "fileOrDirectory"
@@ -114,7 +118,7 @@ function InputSelector(props) {
114118 taskKey = { type }
115119 label = "Output Path"
116120 yamlKey = "DATASET.OUTPUT_PATH"
117- value = { context . outputPath }
121+ value = { workflow . outputPath }
118122 projectContext = { projectContext }
119123 taskContext = { taskContext }
120124 />
@@ -123,7 +127,7 @@ function InputSelector(props) {
123127 >
124128 < UnifiedFileInput
125129 placeholder = "Directory for outputs (e.g., /path/to/outputs/)"
126- value = { context . outputPath || "" }
130+ value = { workflow . outputPath || "" }
127131 onChange = { handleOutputPathChange }
128132 selectionType = "directory"
129133 />
@@ -137,7 +141,7 @@ function InputSelector(props) {
137141 taskKey = { type }
138142 label = "Output Path"
139143 yamlKey = "INFERENCE.OUTPUT_PATH"
140- value = { context . outputPath }
144+ value = { workflow . outputPath }
141145 projectContext = { projectContext }
142146 taskContext = { taskContext }
143147 />
@@ -147,7 +151,7 @@ function InputSelector(props) {
147151 >
148152 < UnifiedFileInput
149153 placeholder = "Directory for results (e.g., /path/to/inference_output/)"
150- value = { context . outputPath || "" }
154+ value = { workflow . outputPath || "" }
151155 onChange = { handleOutputPathChange }
152156 selectionType = "directory"
153157 />
@@ -162,7 +166,7 @@ function InputSelector(props) {
162166 taskKey = { type }
163167 label = "Log Path"
164168 yamlKey = "SOLVER.LOG_DIR"
165- value = { context . logPath }
169+ value = { workflow . logPath }
166170 projectContext = { projectContext }
167171 taskContext = { taskContext }
168172 />
@@ -171,7 +175,7 @@ function InputSelector(props) {
171175 >
172176 < UnifiedFileInput
173177 placeholder = "Please type training log path"
174- value = { context . logPath || "" }
178+ value = { workflow . logPath || "" }
175179 onChange = { handleLogPathChange }
176180 selectionType = "directory"
177181 />
@@ -185,7 +189,7 @@ function InputSelector(props) {
185189 taskKey = { type }
186190 label = "Checkpoint Path"
187191 yamlKey = "MODEL.PRE_MODEL"
188- value = { context . checkpointPath }
192+ value = { workflow . checkpointPath }
189193 projectContext = { projectContext }
190194 taskContext = { taskContext }
191195 />
@@ -195,7 +199,7 @@ function InputSelector(props) {
195199 >
196200 < UnifiedFileInput
197201 placeholder = "Model checkpoint file (e.g., /path/to/checkpoint_00010.pth.tar)"
198- value = { context . checkpointPath || "" }
202+ value = { workflow . checkpointPath || "" }
199203 onChange = { handleCheckpointPathChange }
200204 selectionType = "file"
201205 />
0 commit comments