File tree Expand file tree Collapse file tree
src-tauri/src/modules/yolo/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ pub struct TrainingCompleteEvent {
5858
5959#[ derive( Debug , Serialize , Deserialize ) ]
6060pub struct TrainingConfig {
61- pub name : String ,
61+ #[ serde( default ) ]
62+ pub name : Option < String > ,
6263 pub base_model : String ,
6364 pub epochs : u32 ,
6465 pub batch_size : u32 ,
@@ -127,8 +128,9 @@ pub async fn training_start(
127128 config : TrainingConfig ,
128129) -> Result < CommandResponse < String > , String > {
129130 let ( event_tx, mut event_rx) = tokio:: sync:: mpsc:: unbounded_channel ( ) ;
131+ let name = config. name . unwrap_or_else ( || "yolo_train" . to_string ( ) ) ;
130132 let request = TrainingRequest {
131- name : config . name . clone ( ) ,
133+ name,
132134 base_model : config. base_model ,
133135 epochs : config. epochs ,
134136 batch_size : config. batch_size ,
You can’t perform that action at this time.
0 commit comments