fix: align with fastchat mainstream (#670)
Fastchat mainstream change its return format, and text now is only string in choices structure. So make this change, to work with mainstream fastchat. Signed-off-by: Lei Wen <wenlei03@qiyi.com> Co-authored-by: Lei Wen <wenlei03@qiyi.com>release-notes-05
parent
88d2617a34
commit
b47bdd5d77
|
|
@ -20,7 +20,7 @@ struct Response {
|
|||
|
||||
#[derive(Deserialize)]
|
||||
struct Prediction {
|
||||
text: Vec<String>,
|
||||
text: String,
|
||||
}
|
||||
|
||||
pub struct FastChatEngine {
|
||||
|
|
@ -83,7 +83,7 @@ impl TextGeneration for FastChatEngine {
|
|||
|
||||
let resp: Response = resp.json().await.expect("Failed to parse response");
|
||||
|
||||
resp.choices[0].text[0].clone()
|
||||
resp.choices[0].text.clone()
|
||||
}
|
||||
|
||||
async fn generate_stream(
|
||||
|
|
|
|||
Loading…
Reference in New Issue