Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aon-app-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
aon-app-server
Commits
308db6ac
Commit
308db6ac
authored
Aug 08, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add async
parent
018f97ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
2 deletions
+94
-2
.DS_Store
.DS_Store
+0
-0
replicate_models_version.yaml
conf/replicate_models_version.yaml
+65
-0
task.go
controllers/task.go
+28
-1
lastupdate.tmp
lastupdate.tmp
+1
-1
No files found.
.DS_Store
View file @
308db6ac
No preview for this file type
conf/replicate_models_version.yaml
View file @
308db6ac
...
...
@@ -66,4 +66,69 @@ qwen1.5-7b:
llava-13b
:
version
:
"
b5f6212d032508382d61ff00469ddda3e32fd8a0e75dc39d8a4191bb742157fb"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
chat-tts
:
version
:
"
fdb4f547d19c9591d7e0223c88b14886c110129c0e206ddbb97fe7a344162868"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
whisper
:
version
:
"
be69de6b9dc57b3361dff4122ef4d6876ad4234bf5c879287b48d35c20ce3e83"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
controlnet
:
version
:
"
795433b19458d0f4fa172a7ccf93178d2adb1cb8ab2ad6c8fdc33fdbcd49f477"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
blip
:
version
:
"
2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
gfpgan
:
version
:
"
66a607f2c8ee93966fb2759b0bb93f48a707f46d2f75df5d66db73d3b5d8337d"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
sdxl
:
version
:
"
7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
minigpt-4
:
version
:
"
e447a8583cffd86ce3b93f9c2cd24f2eae603d99ace6afa94b33a08e94a3cd06"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
codeformer
:
version
:
"
78f2bab438ab0ffc85a68cdfd316a2ecd3994b5dd26aa6b3d203357b45e5eb1b"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
real-esrgan
:
version
:
"
f121d640bd286e1fdc67f9799164c1d5be36ff74576ee11c803ae5b665dd46aa"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
blip-2
:
version
:
"
f677695e5e89f8b236e52ecd1d3f01beb44c34606419bcc19345e046d8f786f9"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
bark
:
version
:
"
b76242b40d67c76ab6742e987628a2a9ac019e11d56ab96c4e91ce03b79b2787"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
dreambooth-batch
:
version
:
"
0de6c0b01bd739f96052a4564ca1c8a53ed5246de86c0ef86ca8abe28f9aacad"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
dreambooth
:
version
:
"
a8ba568da0313951a6b311b43b1ea3bf9f2ef7b9fd97ed94cebd7ffd2da66654"
url
:
"
https://api.replicate.com/v1/predictions"
stream
:
false
\ No newline at end of file
controllers/task.go
View file @
308db6ac
...
...
@@ -81,6 +81,19 @@ func (server *TaskController) Prediction() {
server
.
respond
(
http
.
StatusOK
,
err
.
Error
())
return
}
if
async
{
response
:=
struct
{
Task
*
models
.
TaskReturn
`json:"task"`
ExcuteId
string
`json:"excute_id"`
}{
Task
:
&
models
.
TaskReturn
{
Async
:
async
,
},
ExcuteId
:
task
.
ExcuteId
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
response
)
return
}
server
.
respond
(
http
.
StatusOK
,
""
,
result
)
}
...
...
@@ -301,7 +314,9 @@ func uploadToS3(bucket, key string, img image.Image, format string) (string, err
timestamp
:=
time
.
Now
()
.
Unix
()
timestampStr
:=
strconv
.
FormatInt
(
timestamp
,
10
)
key
=
filePath
+
"/"
+
timestampStr
+
"_"
+
key
width
:=
img
.
Bounds
()
.
Dx
()
height
:=
img
.
Bounds
()
.
Dy
()
key
=
filePath
+
"/"
+
timestampStr
+
"_"
+
"width="
+
strconv
.
Itoa
(
width
)
+
"&height="
+
strconv
.
Itoa
(
height
)
+
"_"
+
key
_
,
err
=
client
.
PutObject
(
context
.
TODO
(),
&
s3
.
PutObjectInput
{
Bucket
:
aws
.
String
(
bucket
),
...
...
@@ -729,6 +744,18 @@ func doGetReplicate(url string, task *models.Task, taskResponse *models.TaskResp
output
=
append
(
output
,
value
)
}
}
if
slice
,
ok
:=
temp
.
Output
.
(
map
[
string
]
interface
{});
ok
{
fmt
.
Println
(
"i 是map类型,值为:"
,
slice
)
for
_
,
value
:=
range
slice
{
logs
.
Info
(
"getReplicate value:"
,
value
)
if
str
,
ok1
:=
value
.
(
string
);
ok1
{
fmt
.
Println
(
"i 是字符串类型,值为:"
,
str
)
output
=
append
(
output
,
str
)
}
//output = append(output, value)
}
}
task
.
Status
=
2
isImage
:=
checkFileIsImage
(
output
)
...
...
lastupdate.tmp
View file @
308db6ac
{"/Users/brent/Documents/wubanWork/aon_app_server/controllers":1722309597368049052}
\ No newline at end of file
{"/Users/brent/Documents/wubanWork/aon_app_server/controllers":1723107582385421558}
\ No newline at end of file
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