fix: when send failed, treat the request as stopped (#673)
parent
de827b1e74
commit
89a63dbf33
|
|
@ -90,7 +90,10 @@ impl AsyncTextInferenceEngine {
|
||||||
// Cancelled by client side or hit eos.
|
// Cancelled by client side or hit eos.
|
||||||
stopped = true;
|
stopped = true;
|
||||||
} else if let Some(new_text) = decoding.next_token(token_id) {
|
} else if let Some(new_text) = decoding.next_token(token_id) {
|
||||||
tx.send(new_text).await.expect("send failed");
|
match tx.send(new_text).await {
|
||||||
|
Ok(_) => (),
|
||||||
|
Err(_) => stopped = true,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Stoop words stopped
|
// Stoop words stopped
|
||||||
stopped = true;
|
stopped = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue