mirror of
https://github.com/zhengkai/orca.git
synced 2026-02-04 15:12:26 +08:00
up
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl http://localhost:22035/v1/engines/text-embedding-ada-002/embeddings \
|
||||
API_HOST="http://10.0.84.49:22035"
|
||||
# API_HOST="http://localhost:22035"
|
||||
|
||||
curl "${API_HOST}/v1/engines/text-embedding-ada-002/embeddings" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-d '{"input":["\u80fd\u91cf\u793c\u7269\u662f\u600e\u4e48\u56de\u4e8b\uff1f\u7528\u4e2d\u6587"], "encoding_format": "base64"}'
|
||||
-d '{"input":[ "\u80fd\u91cf\u793c\u7269\u662f\u600e\u4e48\u56de\u4e8b\uff1f\u7528\u4e2d\u6587"], "encoding_format": "base64"}'
|
||||
|
||||
@@ -49,7 +49,7 @@ func (pr *row) fetchRemote() (ab []byte, ok bool, err error) {
|
||||
}
|
||||
|
||||
if rsp.StatusCode >= 200 || rsp.StatusCode < 300 {
|
||||
// ok = true
|
||||
ok = true
|
||||
} else {
|
||||
err = fmt.Errorf(`status code fail: %d`, rsp.StatusCode)
|
||||
b.WriteString(err.Error())
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"project/metrics"
|
||||
"project/pb"
|
||||
"project/util"
|
||||
"project/zj"
|
||||
)
|
||||
|
||||
func doMetrics(ab []byte, cached bool, r *http.Request) {
|
||||
@@ -22,6 +23,9 @@ func doMetrics(ab []byte, cached bool, r *http.Request) {
|
||||
}
|
||||
|
||||
metrics.RspToken(u.PromptTokens, u.TotalTokens, cached)
|
||||
if !cached {
|
||||
zj.J(`token`, u.PromptTokens, u.TotalTokens)
|
||||
}
|
||||
|
||||
ip, err := util.GetIP(r)
|
||||
sip := ip.String()
|
||||
|
||||
@@ -3,7 +3,6 @@ package project
|
||||
import (
|
||||
"project/build"
|
||||
"project/config"
|
||||
"project/tmptest"
|
||||
"project/web"
|
||||
"project/zj"
|
||||
|
||||
@@ -17,7 +16,7 @@ func Start() {
|
||||
|
||||
zj.Init()
|
||||
|
||||
tmptest.Test()
|
||||
// tmptest.Test()
|
||||
|
||||
go web.Server()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user