Spaces:
Runtime error
Runtime error
Update brain.py
Browse files
brain.py
CHANGED
@@ -40,7 +40,10 @@ class StoryGenerator:
|
|
40 |
"""Generate a story using image captioning and language model."""
|
41 |
llm = self.get_llm(model_name)
|
42 |
story = self.prompt_template | llm
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
def generate_story_from_image(self, image, model_name):
|
46 |
"""Generate a story from an image."""
|
|
|
40 |
"""Generate a story using image captioning and language model."""
|
41 |
llm = self.get_llm(model_name)
|
42 |
story = self.prompt_template | llm
|
43 |
+
generated_story = story.invoke(
|
44 |
+
input={"scenario": scenario}
|
45 |
+
).strip().rstrip('</s>').strip()
|
46 |
+
return generated_story
|
47 |
|
48 |
def generate_story_from_image(self, image, model_name):
|
49 |
"""Generate a story from an image."""
|