Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -55,8 +55,10 @@ def infer(
|
|
55 |
negative_prompt = str(negative_prompt) if negative_prompt else ""
|
56 |
|
57 |
# Ensure text input IDs are of type LongTensor
|
58 |
-
if
|
59 |
-
|
|
|
|
|
60 |
|
61 |
image = pipe(
|
62 |
prompt=prompt,
|
@@ -170,4 +172,4 @@ with gr.Blocks(css=css) as demo:
|
|
170 |
)
|
171 |
|
172 |
if __name__ == "__main__":
|
173 |
-
demo.launch()
|
|
|
55 |
negative_prompt = str(negative_prompt) if negative_prompt else ""
|
56 |
|
57 |
# Ensure text input IDs are of type LongTensor
|
58 |
+
if isinstance(prompt, torch.Tensor):
|
59 |
+
prompt = prompt.to(torch.long)
|
60 |
+
if isinstance(negative_prompt, torch.Tensor):
|
61 |
+
negative_prompt = negative_prompt.to(torch.long)
|
62 |
|
63 |
image = pipe(
|
64 |
prompt=prompt,
|
|
|
172 |
)
|
173 |
|
174 |
if __name__ == "__main__":
|
175 |
+
demo.launch()
|