mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 09:33:10 -07:00
minor code clean up
This commit is contained in:
parent
67af2e17e3
commit
173e306104
6 changed files with 6 additions and 21 deletions
|
|
@ -17,7 +17,7 @@ import { useLaunchConfigStore } from '@/stores/launchConfig';
|
|||
import { usePreferencesStore } from '@/stores/preferences';
|
||||
|
||||
interface TerminalTabProps {
|
||||
onServerReady: (url: string) => void;
|
||||
onServerReady: () => void;
|
||||
}
|
||||
|
||||
export interface TerminalTabRef {
|
||||
|
|
@ -26,8 +26,7 @@ export interface TerminalTabRef {
|
|||
|
||||
export const TerminalTab = forwardRef<TerminalTabRef, TerminalTabProps>(
|
||||
({ onServerReady }, ref) => {
|
||||
const { host, port, isImageGenerationMode, isTextMode } =
|
||||
useLaunchConfigStore();
|
||||
const { isImageGenerationMode, isTextMode } = useLaunchConfigStore();
|
||||
const {
|
||||
frontendPreference,
|
||||
imageGenerationFrontendPreference,
|
||||
|
|
@ -80,9 +79,6 @@ export const TerminalTab = forwardRef<TerminalTabRef, TerminalTabProps>(
|
|||
const newData = data.toString();
|
||||
|
||||
if (onServerReady) {
|
||||
const serverHost = host || 'localhost';
|
||||
const serverPort = port || 5001;
|
||||
|
||||
const effectiveFrontend = isTextMode
|
||||
? frontendPreference
|
||||
: imageGenerationFrontendPreference === 'builtin'
|
||||
|
|
@ -98,10 +94,7 @@ export const TerminalTab = forwardRef<TerminalTabRef, TerminalTabProps>(
|
|||
}
|
||||
|
||||
if (newData.includes(signalToCheck)) {
|
||||
setTimeout(
|
||||
() => onServerReady(`http://${serverHost}:${serverPort}`),
|
||||
1500
|
||||
);
|
||||
setTimeout(() => onServerReady(), 3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -113,8 +106,6 @@ export const TerminalTab = forwardRef<TerminalTabRef, TerminalTabProps>(
|
|||
return cleanup;
|
||||
}, [
|
||||
onServerReady,
|
||||
host,
|
||||
port,
|
||||
frontendPreference,
|
||||
imageGenerationFrontendPreference,
|
||||
isImageGenerationMode,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import {
|
|||
selectModelFile,
|
||||
selectInstallDirectory,
|
||||
} from '@/main/modules/koboldcpp/config';
|
||||
import { getLocalModelsForType } from '@/main/modules/koboldcpp/modelDownload';
|
||||
import { getLocalModelsForType } from '@/main/modules/koboldcpp/model-download';
|
||||
import { analyzeGGUFModel } from '@/main/modules/koboldcpp/analyze';
|
||||
import {
|
||||
get as getConfig,
|
||||
|
|
@ -75,7 +75,7 @@ import {
|
|||
quitAndInstall,
|
||||
isUpdateDownloaded,
|
||||
canAutoUpdate,
|
||||
} from '@/main/modules/autoUpdater';
|
||||
} from '@/main/modules/auto-updater';
|
||||
import { calculateOptimalGpuLayers } from '@/utils/node/vram';
|
||||
|
||||
export function setupIPCHandlers() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-comments/disallowComments */
|
||||
import {
|
||||
cpu as siCpu,
|
||||
mem as siMem,
|
||||
|
|
@ -82,8 +81,6 @@ export async function detectGPU() {
|
|||
}
|
||||
|
||||
export async function detectGPUCapabilities() {
|
||||
// WARNING: we're not worrying about the users that update their system
|
||||
// during runtime and not restart. Should we be though?
|
||||
if (gpuCapabilitiesCache) {
|
||||
return gpuCapabilitiesCache;
|
||||
}
|
||||
|
|
@ -336,13 +333,11 @@ function parseRocmOutput(output: string, vulkanInfo: { allGPUs: GPUDevice[] }) {
|
|||
const line = lines[i];
|
||||
const trimmedLine = line.trim();
|
||||
|
||||
// Handle hipInfo format
|
||||
if (handleHipInfoLine(trimmedLine, currentDevice, devices)) {
|
||||
currentDevice = trimmedLine.startsWith('device#') ? {} : currentDevice;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Handle rocminfo format
|
||||
if (line.includes('Marketing Name:')) {
|
||||
const device = parseRocmInfoDevice(line, lines, i, vulkanInfo);
|
||||
if (device) {
|
||||
|
|
@ -351,7 +346,6 @@ function parseRocmOutput(output: string, vulkanInfo: { allGPUs: GPUDevice[] }) {
|
|||
}
|
||||
}
|
||||
|
||||
// Add the last device for hipInfo format
|
||||
if (currentDevice?.name) {
|
||||
devices.push(
|
||||
createDevice(currentDevice.name, currentDevice.isIntegrated || false)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { startFrontend as startSillyTavernFrontend } from '@/main/modules/sillyt
|
|||
import { startFrontend as startOpenWebUIFrontend } from '@/main/modules/openwebui';
|
||||
import { patchKliteEmbd, patchKcppSduiEmbd, filterSpam } from './patches';
|
||||
import { startProxy, stopProxy } from '../proxy';
|
||||
import { resolveModelPath } from '../modelDownload';
|
||||
import { resolveModelPath } from '../model-download';
|
||||
import type {
|
||||
FrontendPreference,
|
||||
ImageGenerationFrontendPreference,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue