update
This commit is contained in:
@@ -243,12 +243,12 @@ func TransReq(chatreq *openai.ChatCompletionRequest) (*bytes.Buffer, error) {
|
||||
var prompt string
|
||||
for _, msg := range chatreq.Messages {
|
||||
switch msg.Role {
|
||||
case "system":
|
||||
prompt += fmt.Sprintf("\n\nHuman:%s", msg.Content)
|
||||
case "user":
|
||||
prompt += fmt.Sprintf("\n\nHuman:%s", msg.Content)
|
||||
case "assistant":
|
||||
prompt += fmt.Sprintf("\n\nAssistant:%s", msg.Content)
|
||||
case "system":
|
||||
prompt += fmt.Sprintf("\n\nSystem:%s", msg.Content)
|
||||
}
|
||||
}
|
||||
transReq.Prompt = prompt + "\n\nAssistant:"
|
||||
@@ -294,6 +294,7 @@ func TransRsp(c *gin.Context, isStream bool, reader *bufio.Reader) {
|
||||
dataChan = make(chan string)
|
||||
stopChan = make(chan bool)
|
||||
)
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user