adi-123 commited on
Commit
434beb0
·
1 Parent(s): 7fd9800

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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": "You are an expert short story writer who specialises in ending stories positively."},
39
- {"role": "user", "content": img_text, "temperature": 1},
40
- {"role": "system", "content": content_prompt, "temperature": 0.7},
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...")