Ketengan-Diffusion-Lab commited on
Commit
429ad32
·
verified ·
1 Parent(s): a0d5d2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -38,7 +38,7 @@ def inference(prompt, image):
38
  text_chunks = [tokenizer(chunk).input_ids for chunk in text.split('<image>')]
39
  input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0)
40
 
41
- image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
42
 
43
  # generate
44
  output_ids = model.generate(
 
38
  text_chunks = [tokenizer(chunk).input_ids for chunk in text.split('<image>')]
39
  input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0)
40
 
41
+ image_tensor = model.process_images([image], model.config).to(dtype=model.dtype, device=model.device) # Move to model's device
42
 
43
  # generate
44
  output_ids = model.generate(