Fix eslint

f7e2d72ac7a4e009075d95ffeee8c8e282543553

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +10 -10Showing whitespace changes
public/scripts/textgen-models.js+8 -8
@@ -489,13 +489,13 @@ async function downloadTabbyModel() {
489489 return;
490490 }
491491
492492 const repoId = downloadHtml.find('input[name="hf_repo_id"]').val().toString();
493493 if (!repoId) {
494494 toastr.error('A HuggingFace repo ID must be provided. Skipping Download.');
495495 return;
496496 }
497497
498498 if (repoId.split("'/"').length !== 2) {
499499 toastr.error('A HuggingFace repo ID must be formatted as Author/Name. Please try again.');
500500 return;
501501 }
@@ -505,18 +505,18 @@ async function downloadTabbyModel() {
505505 folder_name: downloadHtml.find('input[name="folder_name"]').val() || undefined,
506506 revision: downloadHtml.find('input[name="revision"]').val() || undefined,
507507 token: downloadHtml.find('input[name="hf_token"]').val() || undefined,
508508 };
509509
510510 for (const suffix of ["'include"', "'exclude"']) {
511511 const patterns = downloadHtml.find(`textarea[name="tabby_download_${suffix}"]`).val().toString();
512512 if (patterns) {
513513 params[suffix] = patterns.split("'\n"');
514514 }
515515 }
516516
517517 // Params for the server side of ST
518518 params['api_server'] = serverUrl;
519519 params['api_type'] = textgen_settings.type;
520520
521521 toastr.info('Downloading. Check the Tabby console for progress reports.');
522522
@@ -527,7 +527,7 @@ async function downloadTabbyModel() {
527527 });
528528
529529 if (response.status === 403) {
530530 toastr.error("'The provided key has invalid permissions. Please use an admin key for downloading."');
531531 return;
532532 } else if (!response.ok) {
533533 throw new Error(response.statusText);
@@ -536,7 +536,7 @@ async function downloadTabbyModel() {
536536 toastr.success('Download complete.');
537537 } catch (err) {
538538 console.error(err);
539539 toastr.error('Failed to download HuggingFace model in TabbyAPI. Please try again.');
540540 }
541541}
542542
src/endpoints/backends/text-completions.js+2 -2
@@ -599,13 +599,13 @@ tabby.post('/download', jsonParser, async function (request, response) {
599599 headers: { 'Content-Type': 'application/json' },
600600 body: JSON.stringify(request.body),
601601 timeout: 0,
602602 };
603603
604604 setAdditionalHeaders(request, args, baseUrl);
605605
606606 // Check key permissions
607607 const permissionResponse = await fetch(`${baseUrl}/v1/auth/permission`, {
608608 headers: args.headers,
609609 });
610610
611611 if (permissionResponse.ok) {