Update fid_dialogue_pipeline.py

修复在cpu下推理时的错误,这里不应该检查cuda是否可用。这里的逻辑似乎有错误
This commit is contained in:
leway
2023-05-07 14:51:47 +08:00
committed by GitHub
parent 9bfc4a9d83
commit 1f2bb82ea6

View File

@@ -191,8 +191,8 @@ class FidDialoguePipeline(Pipeline):
def postprocess(self, inputs: TokenGeneratorOutput,
**postprocess_params) -> Dict[str, Any]:
if torch.cuda.is_available():
hypotheses = inputs.sequences.detach().cpu().tolist()
# if torch.cuda.is_available():
hypotheses = inputs.sequences.detach().cpu().tolist()
response = self.preprocessor_tokenizer.decode(
hypotheses[0], skip_special_tokens=self.is_t5)