From a66f97e3b619a6051085be8b316b7de2693067a1 Mon Sep 17 00:00:00 2001 From: Landan Seguin Date: Mon, 28 Aug 2023 14:26:15 -0700 Subject: [PATCH] Fix pt. 2 --- diffusion/inference/inference_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diffusion/inference/inference_model.py b/diffusion/inference/inference_model.py index 3d1ad50d..9259b2f5 100644 --- a/diffusion/inference/inference_model.py +++ b/diffusion/inference/inference_model.py @@ -70,10 +70,10 @@ def predict(self, model_requests: List[Dict[str, Any]]): if isinstance(inputs, str): prompts.append(inputs) elif isinstance(inputs, Dict): - if 'prompt' not in req: + if 'prompt' not in inputs: raise RuntimeError('"prompt" must be provided to generate call if using a dict as input') prompts.append(inputs['prompt']) - if 'negative_prompt' in req: + if 'negative_prompt' in inputs: negative_prompts.append(inputs['negative_prompt']) else: raise RuntimeError(f'Input must be of type string or dict, but it is type: {type(inputs)}')