Remove Space

#3
by multimodalart HF staff - opened
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -25,7 +25,7 @@ def predict(image):
25
  inputs = processor(prompts[0], return_tensors="pt").to(device)
26
  generated_ids = model.generate(**inputs, max_length=max_length)
27
  generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
28
- generated_text = generated_text.replace(prompt,"")
29
  return generated_text
30
 
31
  title = "Midjourney-like Image Captioning with IDEFICS"
 
25
  inputs = processor(prompts[0], return_tensors="pt").to(device)
26
  generated_ids = model.generate(**inputs, max_length=max_length)
27
  generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
28
+ generated_text = generated_text.replace(f"{prompt} ","")
29
  return generated_text
30
 
31
  title = "Midjourney-like Image Captioning with IDEFICS"