mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-12 08:47:01 +00:00
desktop: load model from file
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import { app, BrowserWindow, ipcMain, dialog } from 'electron'
|
||||
import { spawn } from 'child_process'
|
||||
import * as path from 'path'
|
||||
|
||||
require('@electron/remote/main').initialize()
|
||||
|
||||
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Webpack
|
||||
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
|
||||
// whether you're running in development or production).
|
||||
@@ -21,9 +24,15 @@ const createWindow = (): void => {
|
||||
minWidth: 400,
|
||||
minHeight: 300,
|
||||
titleBarStyle: 'hiddenInset',
|
||||
transparent: true,
|
||||
webPreferences: {
|
||||
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
},
|
||||
})
|
||||
|
||||
require('@electron/remote/main').enable(mainWindow.webContents)
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY)
|
||||
}
|
||||
@@ -34,7 +43,7 @@ if (app.isPackaged) {
|
||||
console.log(resources)
|
||||
|
||||
// Start the executable
|
||||
const exec = path.join(resources, 'server')
|
||||
const exec = path.join(resources, 'serve', '--port', '5001')
|
||||
console.log(`Starting ${exec}`)
|
||||
const proc = spawn(exec)
|
||||
proc.stdout.on('data', data => {
|
||||
|
||||
Reference in New Issue
Block a user