Update app.py
Browse files
app.py
CHANGED
|
@@ -29,15 +29,16 @@ def txt2story(img_text):
|
|
| 29 |
)
|
| 30 |
|
| 31 |
print("Constructing prompt for story generation...")
|
|
|
|
| 32 |
content_prompt = f'''Based on the image description "{img_text}", conclude the story.
|
| 33 |
Resolve the conflict or summarize the outcome of the situation. Ensure the story MUST
|
| 34 |
have a definitive ending. The end.'''
|
| 35 |
|
| 36 |
print("Preparing message sequences for interaction...")
|
| 37 |
messages = [
|
| 38 |
-
{"role": "system", "content":
|
| 39 |
-
|
| 40 |
-
{"role": "
|
| 41 |
]
|
| 42 |
|
| 43 |
print("Generating story completion using the AI model...")
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
print("Constructing prompt for story generation...")
|
| 32 |
+
|
| 33 |
content_prompt = f'''Based on the image description "{img_text}", conclude the story.
|
| 34 |
Resolve the conflict or summarize the outcome of the situation. Ensure the story MUST
|
| 35 |
have a definitive ending. The end.'''
|
| 36 |
|
| 37 |
print("Preparing message sequences for interaction...")
|
| 38 |
messages = [
|
| 39 |
+
{"role": "system", "content": '''You are an expert short story writer who specialises
|
| 40 |
+
in writing stories on input set of words.''', "temperature": 0.8},
|
| 41 |
+
{"role": "user", "content": "f'Here is input set of words: '{img_text}''", "temperature": 1},
|
| 42 |
]
|
| 43 |
|
| 44 |
print("Generating story completion using the AI model...")
|