Spaces:
Runtime error
Runtime error
ydshieh
commited on
Commit
•
3ca5ee2
1
Parent(s):
13b9f3b
fix caption
Browse files
model.py
CHANGED
@@ -53,7 +53,7 @@ def predict(image):
|
|
53 |
token_ids = np.array(generation.sequences)[0]
|
54 |
caption = tokenizer.decode(token_ids)
|
55 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
56 |
-
caption = caption.replace("à l'arrière-plan", '').replace("Une photo en noir et blanc d", '').replace("Une photo noire et blanche d'", '').replace("en arrière-plan", '')
|
57 |
while ' ' in caption:
|
58 |
caption = caption.replace(' ', ' ')
|
59 |
caption = caption.strip()
|
|
|
53 |
token_ids = np.array(generation.sequences)[0]
|
54 |
caption = tokenizer.decode(token_ids)
|
55 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
56 |
+
caption = caption.replace("à l'arrière-plan", '').replace("Une photo en noir et blanc d'", '').replace("Une photo noire et blanche d'", '').replace("en arrière-plan", '')
|
57 |
while ' ' in caption:
|
58 |
caption = caption.replace(' ', ' ')
|
59 |
caption = caption.strip()
|