Commit
·
1f43406
1
Parent(s):
4c9579d
chore: add word to blacklist
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -46,7 +46,7 @@ class EndpointHandler():
|
|
46 |
)
|
47 |
captions = self.processor.batch_decode(out, skip_special_tokens=True)
|
48 |
|
49 |
-
replace_sets = ("arafed", ""), ("araffe", "")
|
50 |
filtered_captions = [reduce(lambda a, kv: a.replace(*kv).strip(), replace_sets, caption) for caption in captions]
|
51 |
# postprocess the prediction
|
52 |
return {"captions": filtered_captions}
|
|
|
46 |
)
|
47 |
captions = self.processor.batch_decode(out, skip_special_tokens=True)
|
48 |
|
49 |
+
replace_sets = ("arafed", ""), ("araffe", ""), ("araff", "")
|
50 |
filtered_captions = [reduce(lambda a, kv: a.replace(*kv).strip(), replace_sets, caption) for caption in captions]
|
51 |
# postprocess the prediction
|
52 |
return {"captions": filtered_captions}
|