Skip to content

Commit

Permalink
fix: disable unsupported llm settings
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Schuettler <markus.schuettler@tngtech.com>
  • Loading branch information
mschuettlerTNG committed Feb 26, 2025
1 parent 291d168 commit b7306d3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
3 changes: 2 additions & 1 deletion WebUI/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ function initEventHandle() {
const comfyBackendUrl = serviceRegistry?.getService('comfyui-backend')?.baseUrl
const backend = comfyBackendUrl && url.includes(comfyBackendUrl) ? 'comfyui' : 'service'

const imageSubPath = backend === 'comfyui' ? `${ imageUrl.searchParams.get('filename')}` : `${imageUrl.pathname}`
const imageSubPath =
backend === 'comfyui' ? `${imageUrl.searchParams.get('filename')}` : `${imageUrl.pathname}`
return path.join(mediaDir, imageSubPath)
}

Expand Down
34 changes: 17 additions & 17 deletions WebUI/electron/util.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { app } from 'electron'
import path from 'node:path'

export const getMediaDir = () => {
const externalResourcesDir = path.resolve(
app.isPackaged ? process.resourcesPath : path.join(__dirname, '../../external/'),
)
let mediaDir: string
if (process.env.USERPROFILE) {
mediaDir = path.join(process.env.USERPROFILE, 'Documents', 'AI-Playground', 'media')
} else if (process.env.HOME) {
mediaDir = path.join(process.env.HOME, 'AI-Playground', 'media')
} else {
mediaDir = path.join(externalResourcesDir, 'service', 'static', 'sd_out')
}
return mediaDir
}
import { app } from 'electron'
import path from 'node:path'

export const getMediaDir = () => {
const externalResourcesDir = path.resolve(
app.isPackaged ? process.resourcesPath : path.join(__dirname, '../../external/'),
)
let mediaDir: string
if (process.env.USERPROFILE) {
mediaDir = path.join(process.env.USERPROFILE, 'Documents', 'AI-Playground', 'media')
} else if (process.env.HOME) {
mediaDir = path.join(process.env.HOME, 'AI-Playground', 'media')
} else {
mediaDir = path.join(externalResourcesDir, 'service', 'static', 'sd_out')
}
return mediaDir
}
4 changes: 2 additions & 2 deletions WebUI/src/components/SettingsBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<div class="border-b border-color-spilter flex flex-col gap-5 py-4">
<h2 class="text-center font-bold">Answer</h2>
<div class="flex flex-col gap-2">
<div class="flex items-center gap-2">
<div v-if="textInference.backend !== 'openVINO'" class="flex items-center gap-2">
<div class="flex items-center gap-5">
<p>Performance Metrics</p>
<button
Expand All @@ -105,7 +105,7 @@
></button>
</div>
</div>
<div class="flex flex-col gap-2">
<div v-if="textInference.backend !== 'llamaCPP'" class="flex flex-col gap-2">
<p>Max Tokens</p>
<slide-bar
v-model:current="textInference.maxTokens"
Expand Down
6 changes: 5 additions & 1 deletion WebUI/src/views/Answer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@
</button>
</div>
<div
v-if="textInference.metricsEnabled && chat.metrics"
v-if="
textInference.metricsEnabled &&
textInference.backend !== 'openVINO' &&
chat.metrics
"
class="metrics-info text-xs text-gray-400"
>
<span class="mr-2">{{ chat.metrics.num_tokens }} Tokens</span>
Expand Down

0 comments on commit b7306d3

Please sign in to comment.