Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
34eeac1c
authored
Jun 26, 2024
by
Calcium-Ion
Committed by
GitHub
Jun 26, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #333 from Calcium-Ion/suno
Update Suno
parents
a46de6c1
6c4c9d1c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
controller/midjourney.go
+0
-3
main.go
+8
-6
relay/channel/openai/relay-openai.go
+1
-1
web/pnpm-lock.yaml
+0
-0
No files found.
controller/midjourney.go
View file @
34eeac1c
...
...
@@ -19,9 +19,6 @@ import (
)
func
UpdateMidjourneyTaskBulk
()
{
if
!
common
.
IsMasterNode
{
return
}
//imageModel := "midjourney"
ctx
:=
context
.
TODO
()
for
{
...
...
main.go
View file @
34eeac1c
...
...
@@ -89,12 +89,14 @@ func main() {
}
go
controller
.
AutomaticallyTestChannels
(
frequency
)
}
common
.
SafeGoroutine
(
func
()
{
controller
.
UpdateMidjourneyTaskBulk
()
})
common
.
SafeGoroutine
(
func
()
{
controller
.
UpdateTaskBulk
()
})
if
common
.
IsMasterNode
{
common
.
SafeGoroutine
(
func
()
{
controller
.
UpdateMidjourneyTaskBulk
()
})
common
.
SafeGoroutine
(
func
()
{
controller
.
UpdateTaskBulk
()
})
}
if
os
.
Getenv
(
"BATCH_UPDATE_ENABLED"
)
==
"true"
{
common
.
BatchUpdateEnabled
=
true
common
.
SysLog
(
"batch update enabled with interval "
+
strconv
.
Itoa
(
common
.
BatchUpdateInterval
)
+
"s"
)
...
...
relay/channel/openai/relay-openai.go
View file @
34eeac1c
...
...
@@ -187,7 +187,7 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
return
service
.
OpenAIErrorWrapper
(
err
,
"close_response_body_failed"
,
http
.
StatusInternalServerError
),
nil
}
if
simpleResponse
.
Usage
.
TotalTokens
==
0
{
if
simpleResponse
.
Usage
.
TotalTokens
==
0
||
(
simpleResponse
.
Usage
.
PromptTokens
==
0
&&
simpleResponse
.
Usage
.
CompletionTokens
==
0
)
{
completionTokens
:=
0
for
_
,
choice
:=
range
simpleResponse
.
Choices
{
ctkm
,
_
:=
service
.
CountTokenText
(
string
(
choice
.
Message
.
Content
),
model
)
...
...
web/pnpm-lock.yaml
View file @
34eeac1c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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