Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,9 +54,13 @@ def infer(
|
|
54 |
prompt = str(prompt) if prompt else ""
|
55 |
negative_prompt = str(negative_prompt) if negative_prompt else ""
|
56 |
|
|
|
|
|
|
|
|
|
57 |
image = pipe(
|
58 |
-
prompt=
|
59 |
-
negative_prompt=
|
60 |
guidance_scale=torch.tensor(guidance_scale, dtype=torch.float32, device=device),
|
61 |
num_inference_steps=num_inference_steps,
|
62 |
width=width,
|
|
|
54 |
prompt = str(prompt) if prompt else ""
|
55 |
negative_prompt = str(negative_prompt) if negative_prompt else ""
|
56 |
|
57 |
+
# Convert text inputs to Long tensors if necessary
|
58 |
+
text_input_ids = torch.tensor([ord(c) for c in prompt], dtype=torch.long, device=device)
|
59 |
+
neg_text_input_ids = torch.tensor([ord(c) for c in negative_prompt], dtype=torch.long, device=device)
|
60 |
+
|
61 |
image = pipe(
|
62 |
+
prompt=text_input_ids,
|
63 |
+
negative_prompt=neg_text_input_ids,
|
64 |
guidance_scale=torch.tensor(guidance_scale, dtype=torch.float32, device=device),
|
65 |
num_inference_steps=num_inference_steps,
|
66 |
width=width,
|