mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 04:29:22 +01:00
Update fid_dialogue_pipeline.py
修复在cpu下推理时的错误,这里不应该检查cuda是否可用。这里的逻辑似乎有错误
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user