Spaces:
Runtime error
Runtime error
autonomous019
commited on
Commit
•
5669825
1
Parent(s):
b0a4b77
story to ui
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
|
@@ -129,7 +129,7 @@ image = gr.inputs.Image(type="pil")
|
|
129 |
label = gr.outputs.Label(num_top_classes=5)
|
130 |
examples = [["cats.jpg"]]
|
131 |
title = "Generate a Story from an Image"
|
132 |
-
description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit', a
|
133 |
article = "<p style='text-align: center'></p>"
|
134 |
|
135 |
img_info1 = gr.Interface(
|
@@ -143,7 +143,7 @@ img_info2 = gr.Interface(
|
|
143 |
inputs=image,
|
144 |
#outputs=label,
|
145 |
outputs = [
|
146 |
-
gr.outputs.Textbox(label = '
|
147 |
],
|
148 |
)
|
149 |
|
|
|
60 |
MinLengthLogitsProcessor(10, eos_token_id=model.config.eos_token_id),
|
61 |
]
|
62 |
)
|
63 |
+
stopping_criteria = StoppingCriteriaList([MaxLengthCriteria(max_length=80)])
|
64 |
|
65 |
outputs = model.greedy_search(
|
66 |
input_ids, logits_processor=logits_processor, stopping_criteria=stopping_criteria
|
|
|
129 |
label = gr.outputs.Label(num_top_classes=5)
|
130 |
examples = [["cats.jpg"]]
|
131 |
title = "Generate a Story from an Image"
|
132 |
+
description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit', a story is autogenerated as well"
|
133 |
article = "<p style='text-align: center'></p>"
|
134 |
|
135 |
img_info1 = gr.Interface(
|
|
|
143 |
inputs=image,
|
144 |
#outputs=label,
|
145 |
outputs = [
|
146 |
+
gr.outputs.Textbox(label = 'Story')
|
147 |
],
|
148 |
)
|
149 |
|