Update app.py
Browse files
app.py
CHANGED
@@ -27,17 +27,11 @@ def txt2story(img_text):
|
|
27 |
api_key=os.environ["TOGETHER_API_KEY"],
|
28 |
base_url='https://api.together.xyz',
|
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 |
|
38 |
messages = [
|
39 |
{"role": "system", "content": '''You are an expert short story writer who specialises
|
40 |
-
in writing stories on input set of words.
|
|
|
41 |
{"role": "user", "content": "Here is input set of words: {img_text}", "temperature": 1},
|
42 |
]
|
43 |
|
|
|
27 |
api_key=os.environ["TOGETHER_API_KEY"],
|
28 |
base_url='https://api.together.xyz',
|
29 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
messages = [
|
32 |
{"role": "system", "content": '''You are an expert short story writer who specialises
|
33 |
+
in writing stories on input set of words.Ensure the story MUST
|
34 |
+
have a definitive ending.''', "temperature": 0.8},
|
35 |
{"role": "user", "content": "Here is input set of words: {img_text}", "temperature": 1},
|
36 |
]
|
37 |
|