@@ -313,38 +313,56 @@ def __init__(self, args: List[str]) -> None:
313
313
self .hf_upload_dialog .setFixedWidth (500 )
314
314
self .hf_upload_layout = QVBoxLayout ()
315
315
316
+ # Form layout for inputs
317
+ form_layout = QFormLayout ()
318
+
316
319
# Repo input
317
- repo_layout = QHBoxLayout ()
318
320
self .hf_repo_input = QLineEdit ()
319
- repo_layout .addWidget (QLabel ("Repository:" ))
320
- repo_layout .addWidget (self .hf_repo_input )
321
- self .hf_upload_layout .addLayout (repo_layout )
321
+ form_layout .addRow ("Repository:" , self .hf_repo_input )
322
322
323
323
# Remote path input
324
- remote_path_layout = QHBoxLayout ()
325
324
self .hf_remote_path_input = QLineEdit ()
326
- remote_path_layout .addWidget (QLabel ("Remote Path:" ))
327
- remote_path_layout .addWidget (self .hf_remote_path_input )
328
- self .hf_upload_layout .addLayout (remote_path_layout )
325
+ form_layout .addRow ("Remote Path:" , self .hf_remote_path_input )
329
326
330
327
# Local file/folder input
331
328
local_path_layout = QHBoxLayout ()
332
329
self .hf_local_path_input = QLineEdit ()
333
330
local_path_button = QPushButton ("Browse" )
334
331
local_path_button .clicked .connect (self .browse_local_path )
335
- local_path_layout .addWidget (QLabel ("Local Path:" ))
336
332
local_path_layout .addWidget (self .hf_local_path_input )
337
333
local_path_layout .addWidget (local_path_button )
338
- self .hf_upload_layout .addLayout (local_path_layout )
334
+ form_layout .addRow ("Local Path:" , local_path_layout )
335
+
336
+ self .hf_upload_layout .addLayout (form_layout )
339
337
340
338
# Upload type (file or folder)
339
+ upload_type_group = QGroupBox ("Upload Type" )
340
+ upload_type_layout = QHBoxLayout ()
341
341
self .upload_type_group = QButtonGroup ()
342
342
self .upload_type_file = QRadioButton ("File" )
343
343
self .upload_type_folder = QRadioButton ("Folder" )
344
344
self .upload_type_group .addButton (self .upload_type_file )
345
345
self .upload_type_group .addButton (self .upload_type_folder )
346
- self .hf_upload_layout .addWidget (self .upload_type_file )
347
- self .hf_upload_layout .addWidget (self .upload_type_folder )
346
+ upload_type_layout .addWidget (self .upload_type_file )
347
+ upload_type_layout .addWidget (self .upload_type_folder )
348
+ upload_type_group .setLayout (upload_type_layout )
349
+ self .hf_upload_layout .addWidget (upload_type_group )
350
+
351
+ # Repo type (dataset/space/model)
352
+ repo_type_group = QGroupBox ("Repository Type" )
353
+ repo_type_layout = QHBoxLayout ()
354
+ self .repo_type_group = QButtonGroup ()
355
+ self .repo_type_model = QRadioButton ("Model" )
356
+ self .repo_type_dataset = QRadioButton ("Dataset" )
357
+ self .repo_type_space = QRadioButton ("Space" )
358
+ self .repo_type_group .addButton (self .repo_type_model )
359
+ self .repo_type_group .addButton (self .repo_type_dataset )
360
+ self .repo_type_group .addButton (self .repo_type_space )
361
+ repo_type_layout .addWidget (self .repo_type_model )
362
+ repo_type_layout .addWidget (self .repo_type_dataset )
363
+ repo_type_layout .addWidget (self .repo_type_space )
364
+ repo_type_group .setLayout (repo_type_layout )
365
+ self .hf_upload_layout .addWidget (repo_type_group )
348
366
349
367
# Upload button
350
368
upload_button = QPushButton ("Upload" )
@@ -1438,6 +1456,14 @@ def transfer_to_hf(self) -> None:
1438
1456
if remote_path :
1439
1457
command .append (remote_path )
1440
1458
1459
+ # Add repo type argument if selected
1460
+ if self .repo_type_model .isChecked ():
1461
+ command .append ("--repo-type=model" )
1462
+ elif self .repo_type_dataset .isChecked ():
1463
+ command .append ("--repo-type=dataset" )
1464
+ elif self .repo_type_space .isChecked ():
1465
+ command .append ("--repo-type=space" )
1466
+
1441
1467
logs_path = self .logs_input .text ()
1442
1468
ensure_directory (logs_path )
1443
1469
0 commit comments