Spaces:
Runtime error
Runtime error
Commit
·
3dc23d6
1
Parent(s):
5669825
output to string
Browse files
app.py
CHANGED
|
@@ -60,7 +60,7 @@ def create_story(text_seed):
|
|
| 60 |
MinLengthLogitsProcessor(10, eos_token_id=model.config.eos_token_id),
|
| 61 |
]
|
| 62 |
)
|
| 63 |
-
stopping_criteria = StoppingCriteriaList([MaxLengthCriteria(max_length=
|
| 64 |
|
| 65 |
outputs = model.greedy_search(
|
| 66 |
input_ids, logits_processor=logits_processor, stopping_criteria=stopping_criteria
|
|
@@ -106,6 +106,7 @@ def self_caption(image):
|
|
| 106 |
#return(pred_dictionary)
|
| 107 |
preds = ' '.join(preds)
|
| 108 |
story = create_story(preds)
|
|
|
|
| 109 |
return story
|
| 110 |
|
| 111 |
|
|
|
|
| 60 |
MinLengthLogitsProcessor(10, eos_token_id=model.config.eos_token_id),
|
| 61 |
]
|
| 62 |
)
|
| 63 |
+
stopping_criteria = StoppingCriteriaList([MaxLengthCriteria(max_length=200)])
|
| 64 |
|
| 65 |
outputs = model.greedy_search(
|
| 66 |
input_ids, logits_processor=logits_processor, stopping_criteria=stopping_criteria
|
|
|
|
| 106 |
#return(pred_dictionary)
|
| 107 |
preds = ' '.join(preds)
|
| 108 |
story = create_story(preds)
|
| 109 |
+
story = ' '.join(story)
|
| 110 |
return story
|
| 111 |
|
| 112 |
|