Commit 303b33c7 authored by duanjinfei's avatar duanjinfei

compatible llama chinese

parent d7b442d3
......@@ -3,3 +3,7 @@ package models
type BarkOutPut struct {
AudioOut string `json:"audio_out"`
}
type LlamaChinese struct {
Completion string `json:"completion"`
}
......@@ -810,8 +810,13 @@ func parseData(readBody []byte) interface{} {
log.WithField("err", err).Warn("parse string output filed failed:")
var audioOutput *models.BarkOutPut
if err := json.Unmarshal(m["output"], &audioOutput); err != nil {
var llamaChinese *models.LlamaChinese
if err := json.Unmarshal(readBody, &llamaChinese); err != nil {
log.WithField("err", err).Warn("parse audioOutput output filed failed:")
return nil
} else {
return llamaChinese.Completion
}
} else {
return audioOutput.AudioOut
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment