Spaces:
Runtime error
Runtime error
ydshieh
commited on
Commit
•
1fc53da
1
Parent(s):
d29817c
fix syntax
Browse files
model.py
CHANGED
@@ -56,7 +56,7 @@ def predict(image):
|
|
56 |
token_ids = np.array(generation.sequences)[0]
|
57 |
caption = tokenizer.decode(token_ids)
|
58 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
59 |
-
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", '').
|
60 |
while ' ' in caption:
|
61 |
caption = caption.replace(' ', ' ')
|
62 |
caption = caption.strip()
|
|
|
56 |
token_ids = np.array(generation.sequences)[0]
|
57 |
caption = tokenizer.decode(token_ids)
|
58 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
59 |
+
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", '').replace("Un gros plan d'", '').replace("un gros plan d'", '').replace("Une image d'", '')
|
60 |
while ' ' in caption:
|
61 |
caption = caption.replace(' ', ' ')
|
62 |
caption = caption.strip()
|