1aurent commited on
Commit
cf451d4
1 Parent(s): 432150c

modify prompt post processing

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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", "").lstrip()
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