harmionestark commited on
Commit
c3233df
Β·
verified Β·
1 Parent(s): dd361f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -54,6 +54,10 @@ 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,
@@ -166,4 +170,4 @@ with gr.Blocks(css=css) as demo:
166
  )
167
 
168
  if __name__ == "__main__":
169
- demo.launch()
 
54
  prompt = str(prompt) if prompt else ""
55
  negative_prompt = str(negative_prompt) if negative_prompt else ""
56
 
57
+ # Ensure text input IDs are of type LongTensor
58
+ if hasattr(pipe.text_encoder, 'input_ids'):
59
+ pipe.text_encoder.input_ids = pipe.text_encoder.input_ids.to(torch.long)
60
+
61
  image = pipe(
62
  prompt=prompt,
63
  negative_prompt=negative_prompt,
 
170
  )
171
 
172
  if __name__ == "__main__":
173
+ demo.launch()