harmionestark commited on
Commit
f52c683
Β·
verified Β·
1 Parent(s): a35806e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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=prompt,
59
- negative_prompt=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,