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
7762584f
"...text-generation-inference.git" did not exist on "0e9ed1a8c2ca5023388999c42dde2976e026fe13"
Commit
7762584f
authored
Jul 11, 2023
by
Eva Ho
Browse files
address comments
parent
acc31427
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
app/src/index.ts
app/src/index.ts
+10
-13
No files found.
app/src/index.ts
View file @
7762584f
...
@@ -13,18 +13,15 @@ require('@electron/remote/main').initialize()
...
@@ -13,18 +13,15 @@ require('@electron/remote/main').initialize()
const
store
=
new
Store
()
const
store
=
new
Store
()
let
tray
:
Tray
|
null
=
null
let
tray
:
Tray
|
null
=
null
const
logFile
=
new
winston
.
transports
.
DailyRotateFile
({
const
logFile
=
new
winston
.
transports
.
File
({
filename
:
path
.
join
(
app
.
getPath
(
'
home
'
),
'
.ollama
'
,
'
logs
'
,
'
server-%DATE%.log
'
),
filename
:
path
.
join
(
app
.
getPath
(
'
home
'
),
'
.ollama
'
,
'
logs
'
,
'
server.log
'
),
datePattern
:
'
YYYY-MM-DD-HH
'
,
maxsize
:
1024
*
1024
*
20
,
zippedArchive
:
true
,
maxFiles
:
5
,
maxSize
:
'
20m
'
,
maxFiles
:
'
7d
'
,
});
});
const
logger
=
winston
.
createLogger
({
const
logger
=
winston
.
createLogger
({
transports
:
[
logFile
],
transports
:
[
logFile
],
format
:
winston
.
format
.
combine
(
format
:
winston
.
format
.
combine
(
winston
.
format
.
colorize
(),
winston
.
format
.
timestamp
(),
winston
.
format
.
timestamp
(),
winston
.
format
.
printf
(
info
=>
`
${
info
.
timestamp
}
${
info
.
level
}
:
${
info
.
message
}
`
)
winston
.
format
.
printf
(
info
=>
`
${
info
.
timestamp
}
${
info
.
level
}
:
${
info
.
message
}
`
)
)
)
...
@@ -64,10 +61,10 @@ function server() {
...
@@ -64,10 +61,10 @@ function server() {
const
proc
=
spawn
(
binary
,
[
'
serve
'
])
const
proc
=
spawn
(
binary
,
[
'
serve
'
])
proc
.
stdout
.
on
(
'
data
'
,
data
=>
{
proc
.
stdout
.
on
(
'
data
'
,
data
=>
{
logger
.
info
(
`
[
server
]
${
data
.
toString
()}
`
)
logger
.
info
(
`server
:
${
data
.
toString
()}
`
)
})
})
proc
.
stderr
.
on
(
'
data
'
,
data
=>
{
proc
.
stderr
.
on
(
'
data
'
,
data
=>
{
logger
.
error
(
`
[
server
]
${
data
.
toString
()}
`
)
logger
.
error
(
`server
:
${
data
.
toString
()}
`
)
})
})
proc
.
on
(
'
exit
'
,
()
=>
{
proc
.
on
(
'
exit
'
,
()
=>
{
...
@@ -107,12 +104,12 @@ function installCLI() {
...
@@ -107,12 +104,12 @@ function installCLI() {
`
`
exec
(
`osascript -e '
${
command
}
'`
,
(
error
:
Error
|
null
,
stdout
:
string
,
stderr
:
string
)
=>
{
exec
(
`osascript -e '
${
command
}
'`
,
(
error
:
Error
|
null
,
stdout
:
string
,
stderr
:
string
)
=>
{
if
(
error
)
{
if
(
error
)
{
logger
.
error
(
`
[
CLI
]
Failed to install CLI -
${
error
.
message
}
`
)
logger
.
error
(
`CLI
:
Failed to install CLI -
${
error
.
message
}
`
)
return
return
}
}
logger
.
info
(
`
[
CLI
]
${
stdout
}
}`
)
logger
.
info
(
`CLI
:
${
stdout
}
}`
)
logger
.
error
(
`
[
CLI
]
${
stderr
}
`
)
logger
.
error
(
`CLI
:
${
stderr
}
`
)
})
})
}
}
})
})
...
@@ -206,7 +203,7 @@ if (app.isPackaged) {
...
@@ -206,7 +203,7 @@ if (app.isPackaged) {
}
}
autoUpdater
.
on
(
'
error
'
,
e
=>
{
autoUpdater
.
on
(
'
error
'
,
e
=>
{
logger
.
error
(
`
[
auto updater
]
update check failed -
${
e
.
message
}
`
)
logger
.
error
(
`auto updater
:
update check failed -
${
e
.
message
}
`
)
})
})
autoUpdater
.
on
(
'
update-downloaded
'
,
(
event
,
releaseNotes
,
releaseName
)
=>
{
autoUpdater
.
on
(
'
update-downloaded
'
,
(
event
,
releaseNotes
,
releaseName
)
=>
{
...
...
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