mrm8488 multimodalart HF staff commited on
Commit
a853a81
1 Parent(s): 5bbc196

Remove Space (#3)

Browse files

- Remove Space (e5113d08dced01513564c456ec99530c71b48381)


Co-authored-by: Apolinário from multimodal AI art <multimodalart@users.noreply.huggingface.co>

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"