Spaces:
Running
on
Zero
Running
on
Zero
modify prompt post processing
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def generate_caption(
|
|
61 |
outputs = outputs[:, inputs["input_ids"].shape[1] :]
|
62 |
result = tokenizer.decode(outputs[0])
|
63 |
|
64 |
-
result = result.replace("This image showcases", "").
|
65 |
return result
|
66 |
|
67 |
|
|
|
61 |
outputs = outputs[:, inputs["input_ids"].shape[1] :]
|
62 |
result = tokenizer.decode(outputs[0])
|
63 |
|
64 |
+
result = result.replace("This image showcases", "").strip().removesuffix("</s>").strip().capitalize()
|
65 |
return result
|
66 |
|
67 |
|