Spaces:
Runtime error
Runtime error
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>
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"
|