Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
39f4d8ed
Commit
39f4d8ed
authored
Jul 06, 2023
by
Jeffrey Morgan
Browse files
always use `ollama` binary
parent
7cf59050
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
app/README.md
app/README.md
+2
-2
app/forge.config.ts
app/forge.config.ts
+2
-1
app/src/index.ts
app/src/index.ts
+23
-1
No files found.
app/README.md
View file @
39f4d8ed
...
@@ -6,10 +6,10 @@ This app builds upon Ollama to provide a desktop experience for running models.
...
@@ -6,10 +6,10 @@ This app builds upon Ollama to provide a desktop experience for running models.
## Developing
## Developing
In the background run
the ollama
server
`ollama.py`
:
First, build
the
`
ollama
`
binary
:
```
```
poetry -C .. run ollama serve
make -C ..
```
```
Then run the desktop app with
`npm start`
:
Then run the desktop app with
`npm start`
:
...
...
app/forge.config.ts
View file @
39f4d8ed
...
@@ -8,6 +8,7 @@ import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-nati
...
@@ -8,6 +8,7 @@ import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-nati
import
{
WebpackPlugin
}
from
'
@electron-forge/plugin-webpack
'
import
{
WebpackPlugin
}
from
'
@electron-forge/plugin-webpack
'
import
*
as
path
from
'
path
'
import
*
as
path
from
'
path
'
import
*
as
fs
from
'
fs
'
import
*
as
fs
from
'
fs
'
import
*
as
os
from
'
fs
'
import
{
mainConfig
}
from
'
./webpack.main.config
'
import
{
mainConfig
}
from
'
./webpack.main.config
'
import
{
rendererConfig
}
from
'
./webpack.renderer.config
'
import
{
rendererConfig
}
from
'
./webpack.renderer.config
'
...
@@ -19,7 +20,7 @@ const config: ForgeConfig = {
...
@@ -19,7 +20,7 @@ const config: ForgeConfig = {
appVersion
:
process
.
env
.
VERSION
||
packageJson
.
version
,
appVersion
:
process
.
env
.
VERSION
||
packageJson
.
version
,
asar
:
true
,
asar
:
true
,
icon
:
'
./images/icon
'
,
icon
:
'
./images/icon
'
,
extraResource
:
[
'
../ollama
'
,
'
../ggml-metal.metal
'
],
extraResource
:
[
'
../ollama
'
,
...(
process
.
platform
===
'
darwin
'
?
[
'
../ggml-metal.metal
'
]
:
[])]
,
...(
process
.
env
.
SIGN
...(
process
.
env
.
SIGN
?
{
?
{
osxSign
:
{
osxSign
:
{
...
...
app/src/index.ts
View file @
39f4d8ed
...
@@ -57,6 +57,25 @@ if (app.isPackaged) {
...
@@ -57,6 +57,25 @@ if (app.isPackaged) {
})
})
}
}
function
server
()
{
const
binary
=
app
.
isPackaged
?
path
.
join
(
process
.
resourcesPath
,
'
ollama
'
)
:
path
.
resolve
(
__dirname
,
'
..
'
,
'
..
'
,
'
ollama
'
)
console
.
log
(
`Starting server`
)
const
proc
=
spawn
(
binary
,
[
'
serve
'
])
proc
.
stdout
.
on
(
'
data
'
,
data
=>
{
console
.
log
(
`server:
${
data
}
`
)
})
proc
.
stderr
.
on
(
'
data
'
,
data
=>
{
console
.
error
(
`server:
${
data
}
`
)
})
process
.
on
(
'
exit
'
,
()
=>
{
proc
.
kill
()
})
}
function
installCLI
()
{
function
installCLI
()
{
const
symlinkPath
=
'
/usr/local/bin/ollama
'
const
symlinkPath
=
'
/usr/local/bin/ollama
'
...
@@ -93,7 +112,10 @@ function installCLI() {
...
@@ -93,7 +112,10 @@ function installCLI() {
// Some APIs can only be used after this event occurs.
// Some APIs can only be used after this event occurs.
app
.
on
(
'
ready
'
,
()
=>
{
app
.
on
(
'
ready
'
,
()
=>
{
createWindow
()
createWindow
()
installCLI
()
if
(
app
.
isPackaged
)
{
installCLI
()
}
})
})
// Quit when all windows are closed, except on macOS. There, it's common
// Quit when all windows are closed, except on macOS. There, it's common
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment