Spaces:
Runtime error
Runtime error
bipin
commited on
Commit
·
cf0876f
1
Parent(s):
8985863
bug fixes in clip model squence length
Browse files- app.py +0 -2
- gpt2_story_gen.py +1 -0
app.py
CHANGED
@@ -15,8 +15,6 @@ def main(pil_image, genre, model, use_beam_search=False):
|
|
15 |
elif model.lower()=='conceptual':
|
16 |
model_file = conceptual_weights
|
17 |
|
18 |
-
download_pretrained_model(model.lower(), file_to_save=model_file)
|
19 |
-
|
20 |
image_caption = generate_caption(
|
21 |
model_path=model_file,
|
22 |
pil_image=pil_image,
|
|
|
15 |
elif model.lower()=='conceptual':
|
16 |
model_file = conceptual_weights
|
17 |
|
|
|
|
|
18 |
image_caption = generate_caption(
|
19 |
model_path=model_file,
|
20 |
pil_image=pil_image,
|
gpt2_story_gen.py
CHANGED
@@ -16,6 +16,7 @@ def generate_story(image_caption, image, genre):
|
|
16 |
clip_ranker_inputs = clip_ranker_processor(
|
17 |
text=stories,
|
18 |
images=image,
|
|
|
19 |
return_tensors='pt',
|
20 |
padding=True
|
21 |
)
|
|
|
16 |
clip_ranker_inputs = clip_ranker_processor(
|
17 |
text=stories,
|
18 |
images=image,
|
19 |
+
truncation=True,
|
20 |
return_tensors='pt',
|
21 |
padding=True
|
22 |
)
|