markhristov commited on
Commit
40aa7a0
·
1 Parent(s): 2ee629b

Convert input_ids to float32 data type

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -27,7 +27,8 @@ scheduler = LMSDiscreteScheduler(beta_start=beta_start, beta_end=beta_end, beta_
27
  def text_enc(prompts, maxlen=None):
28
  if maxlen is None: maxlen = tokenizer.model_max_length
29
  inp = tokenizer(prompts, padding="max_length", max_length=maxlen, truncation=True, return_tensors="pt")
30
- input_ids = inp.input_ids.long() # Convert input_ids to Long data type
 
31
  return text_encoder(input_ids)[0]
32
 
33
  def do_both(prompts):
 
27
  def text_enc(prompts, maxlen=None):
28
  if maxlen is None: maxlen = tokenizer.model_max_length
29
  inp = tokenizer(prompts, padding="max_length", max_length=maxlen, truncation=True, return_tensors="pt")
30
+ input_ids = inp.input_ids
31
+ input_ids = input_ids.to(torch.float32) # Convert input_ids to float32 data type
32
  return text_encoder(input_ids)[0]
33
 
34
  def do_both(prompts):