From 13ae839a55dba0d95a09e4713fbdfd298e5af0d6 Mon Sep 17 00:00:00 2001 From: julianbollig Date: Thu, 30 Jan 2025 16:53:57 +0100 Subject: [PATCH] get rid of linter warnings - part I Signed-off-by: julianbollig --- .../electron/subprocesses/aiBackendService.ts | 23 +++++++++---------- .../subprocesses/llamaCppBackendService.ts | 19 ++++++++------- WebUI/src/components/DropSelector.vue | 2 +- WebUI/src/components/PaintInfo.vue | 1 + WebUI/src/components/Rag.vue | 6 ++++- .../components/ui/slider/ResolutionPicker.vue | 2 +- WebUI/src/views/Answer.vue | 5 ++-- WebUI/src/views/Create.vue | 2 ++ WebUI/src/views/Enhance.vue | 2 ++ 9 files changed, 35 insertions(+), 27 deletions(-) diff --git a/WebUI/electron/subprocesses/aiBackendService.ts b/WebUI/electron/subprocesses/aiBackendService.ts index 31051e66..de7fd048 100644 --- a/WebUI/electron/subprocesses/aiBackendService.ts +++ b/WebUI/electron/subprocesses/aiBackendService.ts @@ -21,11 +21,10 @@ export class AiBackendService extends LongLivedPythonApiService { async *set_up(): AsyncIterable { this.setStatus('installing') this.appLogger.info('setting up service', this.name) - const self = this try { yield { - serviceName: self.name, + serviceName: this.name, step: 'start', status: 'executing', debugMessage: 'starting to set up environment', @@ -35,31 +34,31 @@ export class AiBackendService extends LongLivedPythonApiService { const deviceArch = await self.lsLevelZero.detectDevice() yield { - serviceName: self.name, + serviceName: this.name, step: `Detecting intel device`, status: 'executing', debugMessage: `detected intel hardware ${deviceArch}`, } yield { - serviceName: self.name, + serviceName: this.name, step: `install dependencies`, status: 'executing', debugMessage: `installing dependencies`, } const deviceSpecificRequirements = existingFileOrError( - path.join(self.serviceDir, `requirements-${deviceArch}.txt`), + path.join(this.serviceDir, `requirements-${deviceArch}.txt`), ) await this.pip.run(['install', '-r', deviceSpecificRequirements]) if (deviceArch === 'bmg') { - const intelSpecificExtension = existingFileOrError(self.customIntelExtensionForPytorch) + const intelSpecificExtension = existingFileOrError(this.customIntelExtensionForPytorch) await this.pip.run(['install', intelSpecificExtension]) } - const commonRequirements = existingFileOrError(path.join(self.serviceDir, 'requirements.txt')) + const commonRequirements = existingFileOrError(path.join(this.serviceDir, 'requirements.txt')) await this.uvPip.run(['install', '-r', commonRequirements]) yield { - serviceName: self.name, + serviceName: this.name, step: `install dependencies`, status: 'executing', debugMessage: `dependencies installed`, @@ -67,17 +66,17 @@ export class AiBackendService extends LongLivedPythonApiService { this.setStatus('notYetStarted') yield { - serviceName: self.name, + serviceName: this.name, step: 'end', status: 'success', debugMessage: `service set up completely`, } } catch (e) { - self.appLogger.warn(`Set up of service failed due to ${e}`, self.name, true) - self.appLogger.warn(`Aborting set up of ${self.name} service environment`, self.name, true) + this.appLogger.warn(`Set up of service failed due to ${e}`, this.name, true) + this.appLogger.warn(`Aborting set up of ${this.name} service environment`, this.name, true) this.setStatus('installationFailed') yield { - serviceName: self.name, + serviceName: this.name, step: 'end', status: 'failed', debugMessage: `Failed to setup python environment due to ${e}`, diff --git a/WebUI/electron/subprocesses/llamaCppBackendService.ts b/WebUI/electron/subprocesses/llamaCppBackendService.ts index b36d7caf..36658208 100644 --- a/WebUI/electron/subprocesses/llamaCppBackendService.ts +++ b/WebUI/electron/subprocesses/llamaCppBackendService.ts @@ -27,11 +27,10 @@ export class LlamaCppBackendService extends LongLivedPythonApiService { async *set_up(): AsyncIterable { this.setStatus('installing') this.appLogger.info('setting up service', this.name) - const self = this try { yield { - serviceName: self.name, + serviceName: this.name, step: 'start', status: 'executing', debugMessage: 'starting to set up python environment', @@ -41,19 +40,19 @@ export class LlamaCppBackendService extends LongLivedPythonApiService { const deviceArch = await self.lsLevelZero.detectDevice() yield { - serviceName: self.name, + serviceName: this.name, step: `Detecting intel device`, status: 'executing', debugMessage: `detected intel hardware ${deviceArch}`, } yield { - serviceName: self.name, + serviceName: this.name, step: `install dependencies`, status: 'executing', debugMessage: `installing dependencies`, } - const commonRequirements = existingFileOrError(path.join(self.serviceDir, 'requirements.txt')) + const commonRequirements = existingFileOrError(path.join(this.serviceDir, 'requirements.txt')) const intelSpecificExtensionDir = app.isPackaged ? this.baseDir : path.join(__dirname, '../../external') @@ -63,7 +62,7 @@ export class LlamaCppBackendService extends LongLivedPythonApiService { await this.uvPip.pip.run(['install', intelSpecificExtension]) await this.uvPip.run(['install', '-r', commonRequirements]) yield { - serviceName: self.name, + serviceName: this.name, step: `install dependencies`, status: 'executing', debugMessage: `dependencies installed`, @@ -71,17 +70,17 @@ export class LlamaCppBackendService extends LongLivedPythonApiService { this.setStatus('notYetStarted') yield { - serviceName: self.name, + serviceName: this.name, step: 'end', status: 'success', debugMessage: `service set up completely`, } } catch (e) { - self.appLogger.warn(`Set up of service failed due to ${e}`, self.name, true) - self.appLogger.warn(`Aborting set up of ${self.name} service environment`, self.name, true) + this.appLogger.warn(`Set up of service failed due to ${e}`, this.name, true) + this.appLogger.warn(`Aborting set up of ${this.name} service environment`, this.name, true) this.setStatus('installationFailed') yield { - serviceName: self.name, + serviceName: this.name, step: 'end', status: 'failed', debugMessage: `Failed to setup python environment due to ${e}`, diff --git a/WebUI/src/components/DropSelector.vue b/WebUI/src/components/DropSelector.vue index e58ec2c7..8ba46333 100644 --- a/WebUI/src/components/DropSelector.vue +++ b/WebUI/src/components/DropSelector.vue @@ -22,7 +22,7 @@ class="v-drop-select-list absolute left-0 top-0" :style="{ translate: translate, width: `${listRect.width}px` }" > -
  • +
  • {{ item }}
  • diff --git a/WebUI/src/components/PaintInfo.vue b/WebUI/src/components/PaintInfo.vue index 227f693b..efa7b05d 100644 --- a/WebUI/src/components/PaintInfo.vue +++ b/WebUI/src/components/PaintInfo.vue @@ -9,6 +9,7 @@
  • {{ k }} {{ getModeText(k as string, v) }} diff --git a/WebUI/src/components/Rag.vue b/WebUI/src/components/Rag.vue index c9a44c72..82707dc9 100644 --- a/WebUI/src/components/Rag.vue +++ b/WebUI/src/components/Rag.vue @@ -21,7 +21,11 @@ @drop="dropFileToUpload" @dragover="dragOverHandler" > -
    +
    {{ item.filename }} diff --git a/WebUI/src/components/ui/slider/ResolutionPicker.vue b/WebUI/src/components/ui/slider/ResolutionPicker.vue index a3e2e956..3db4d149 100644 --- a/WebUI/src/components/ui/slider/ResolutionPicker.vue +++ b/WebUI/src/components/ui/slider/ResolutionPicker.vue @@ -181,7 +181,7 @@ const sliderModel = computed({ -