Skip to content

Commit 8f180f8

Browse files
committed
Update hf trust code flag checkbix
1 parent d90f014 commit 8f180f8

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/webViews/tools/huggingFaceImporter.webview.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,15 @@ export const huggingFaceMigrateWebView = async (buckets: string[]): Promise<stri
325325
<br>
326326
<label for="repoLink">Repo Link:</label>
327327
<input type="text" id="repoLink" name="repoLink" placeholder="e.g., username/dataset_name">
328+
<div id="trust-code-container" class="checkbox-row">
329+
<div class="checkbox-container tooltip">
330+
<input type="checkbox" id="trust-remote-code" name="trust-remote-code">
331+
<label for="trust-remote-code">Trust Remote Code</label>
332+
<span class="tooltiptext">Check to enable Trust remote code flag.</span>
333+
</div>
334+
</div>
328335
<div class="form-row" id="repoInputContainer" style="display:none;">
336+
<br>
329337
<input type="submit" value="Load Configs" onclick="onLoadConfigsClick(event)" class="redButton">
330338
</div>
331339
<div id="loader" style="display: none; text-align: center; margin: 20px 0;">
@@ -337,13 +345,6 @@ export const huggingFaceMigrateWebView = async (buckets: string[]): Promise<stri
337345
<input type="text" id="filePaths" name="filePaths" placeholder="e.g., /path/to/file1,/path/to/file2">
338346
</div>
339347
<br>
340-
<div class="checkbox-row">
341-
<div class="checkbox-container tooltip">
342-
<input type="checkbox" id="trust-remote-code" name="trust-remote-code" checked>
343-
<label for="trust-remote-code">Trust Remote Code</label>
344-
<span class="tooltiptext">Check to enable Trust remote code flag.</span>
345-
</div>
346-
</div>
347348
<div class="validation-error" id="validation-error-connect"></div>
348349
<div id="configContainer" style="display:none;">
349350
<div class="separator-container">
@@ -408,16 +409,24 @@ export const huggingFaceMigrateWebView = async (buckets: string[]): Promise<stri
408409
$(document).ready(function () {
409410
// Initialize Select2 on all dropdowns
410411
$('.js-select2').select2({ width: '100%' });
412+
// Show repo input container by default since repo radio is checked by default
413+
$('#repoInputContainer').show();
414+
$('#pathInputContainer').hide();
415+
416+
$('#trust-code-container').insertBefore('#repoInputContainer');
411417
// Event listener for dataMethod radio buttons
412418
$('input[name="dataMethod"]').change(function () {
413419
if ($('#useRepo').is(':checked')) {
414420
$('#repoInputContainer').show(); // Show repo input
415421
$('#pathInputContainer').hide(); // Hide path input
416422
$('#repoLink').val(''); // Clear repo link input
423+
$('#trust-code-container').insertBefore('#repoInputContainer');
417424
} else if ($('#usePath').is(':checked')) {
418425
$('#repoInputContainer').hide(); // Hide repo input
419426
$('#pathInputContainer').show(); // Show path input
420427
$('#filePaths').val(''); // Clear file paths input
428+
$('#trust-code-container').insertAfter('#pathInputContainer');
429+
421430
}
422431
// Hide config and splits until the configs are loaded
423432
$('#configContainer').hide();
@@ -426,9 +435,6 @@ export const huggingFaceMigrateWebView = async (buckets: string[]): Promise<stri
426435
$('#configs').prop('disabled', true);
427436
$('#splits').prop('disabled', true);
428437
});
429-
// Initially hide both input containers
430-
$('#repoInputContainer').hide();
431-
$('#pathInputContainer').hide();
432438
});
433439
434440
function showLoader() {

0 commit comments

Comments
 (0)