more fixes and improvements before final release

This commit is contained in:
Egor 2025-09-04 00:05:33 -07:00
parent 8c7edeae1a
commit 2b912cb22e
4 changed files with 25 additions and 72 deletions

View file

@ -1,7 +1,7 @@
{
"name": "gerbil",
"productName": "Gerbil",
"version": "1.0.0",
"version": "0.9.10",
"description": "Run Large Language Models locally",
"main": "out/main/index.js",
"homepage": "./",

View file

@ -41,7 +41,7 @@ export const AboutTab = () => {
}
const versionItems = [
{ label: 'App Version', value: versionInfo.appVersion },
{ label: PRODUCT_NAME, value: versionInfo.appVersion },
{ label: 'Electron', value: versionInfo.electronVersion },
{ label: 'Node.js', value: versionInfo.nodeVersion },
{ label: 'Chromium', value: versionInfo.chromeVersion },
@ -54,7 +54,7 @@ export const AboutTab = () => {
const copyVersionInfo = async () => {
const info = [
`${PRODUCT_NAME} v${versionInfo.appVersion}`,
`${PRODUCT_NAME}: v${versionInfo.appVersion}`,
`Electron: ${versionInfo.electronVersion}`,
`Node.js: ${versionInfo.nodeVersion}`,
`Chromium: ${versionInfo.chromeVersion}`,
@ -137,12 +137,12 @@ export const AboutTab = () => {
</Card>
<Card withBorder radius="md" p="xs" style={{ position: 'relative' }}>
<Tooltip label="Copy info">
<Tooltip label="Copy Version Info">
<ActionIcon
variant="subtle"
size="sm"
onClick={copyVersionInfo}
aria-label="Copy Info"
aria-label="Copy Version Info"
style={{
position: 'absolute',
top: 8,

View file

@ -133,6 +133,10 @@ export class SillyTavernManager {
> {
const env = { ...process.env };
if (process.platform === 'win32') {
return env;
}
const versionManagerPaths = [
join(homedir(), '.local', 'share', 'fnm', 'node-versions'),
join(homedir(), '.nvm', 'versions', 'node'),
@ -144,19 +148,12 @@ export class SillyTavernManager {
if (process.platform === 'darwin') {
systemPaths.push('/opt/homebrew/bin', '/usr/local/bin');
}
if (process.platform === 'win32') {
versionManagerPaths.push(
join(homedir(), 'AppData', 'Local', 'fnm', 'node-versions'),
join(homedir(), 'AppData', 'Roaming', 'nvm')
);
}
for (const systemPath of systemPaths) {
try {
await access(systemPath);
if (await this.tryAddPathToEnv(env, systemPath)) {
return env;
}
await this.tryAddPathToEnv(env, systemPath);
return env;
} catch {
continue;
}
@ -174,7 +171,11 @@ export class SillyTavernManager {
async isNpxAvailable(): Promise<boolean> {
try {
const env = await this.getNodeEnvironment();
const testProcess = spawn('npx', ['--version'], { stdio: 'pipe', env });
const testProcess = spawn('npx', ['--version'], {
stdio: 'pipe',
env,
shell: process.platform === 'win32',
});
return new Promise<boolean>((resolve) => {
const timeout = setTimeout(() => {
@ -203,6 +204,7 @@ export class SillyTavernManager {
stdio: ['pipe', 'pipe', 'pipe'],
detached: false,
env,
shell: process.platform === 'win32',
});
}

View file

@ -55,68 +55,19 @@ export const sortDownloadsByType = <T extends { name: string }>(
});
export const pretifyBinName = (binName: string): string => {
const cleanName = stripAssetExtensions(binName);
const cleanName = stripAssetExtensions(binName).toLowerCase();
let name = cleanName.replace(/^koboldcpp[-_]?/, '');
if (!name) {
return 'Windows (x64)';
if (cleanName.includes(ASSET_SUFFIXES.ROCM)) {
return 'ROCm';
}
const platforms = {
linux: 'Linux',
mac: 'macOS',
};
const architectures = {
x64: 'x64',
arm64: 'ARM64',
};
const variants = {
rocm: 'ROCm',
nocuda: 'NoCUDA',
oldpc: 'OldPC',
};
const parts: string[] = [];
let workingName = name.toLowerCase();
let platform = '';
for (const [key, value] of Object.entries(platforms)) {
if (workingName.includes(key)) {
platform = value;
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
break;
}
if (cleanName.endsWith(ASSET_SUFFIXES.OLDPC)) {
return 'Old PC';
}
let arch = '';
for (const [key, value] of Object.entries(architectures)) {
if (workingName.includes(key)) {
arch = value;
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
break;
}
if (cleanName.endsWith(ASSET_SUFFIXES.NOCUDA)) {
return 'No CUDA';
}
const foundVariants: string[] = [];
for (const [key, value] of Object.entries(variants)) {
if (workingName.includes(key)) {
foundVariants.push(value);
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
}
}
if (platform) parts.push(platform);
if (arch) parts.push(`(${arch})`);
if (foundVariants.length > 0) {
parts.push(`- ${foundVariants.join(', ')}`);
}
if (parts.length === 0) {
return cleanName.replace('koboldcpp-', '').replace(/^-+/, '') || 'Standard';
}
return parts.join(' ');
return 'Standard';
};