Kumarkishalaya commited on
Commit
72751a3
·
verified ·
1 Parent(s): 8685dad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -85,18 +85,16 @@ def generate_story(comments, temperature=0.7):
85
  completion = client.chat.completions.create(
86
  model="gpt-4o",
87
  messages=[{"role": "system", "content": f"""
88
- The comments are given here: {comments_text}. ignore the comment which has lyrics of the song,
89
- ignore all comments similar to 'anyone in 2024',
90
- Read all the comments, understand the emotions people are feeling and pick the third most common emotion
91
- and create a story in first person (the person can be randomly young or old and the story can be
92
- based in past or future) based on that emotion picking a random character keep the words
93
  simple and a bit profound but overall simple words. Give more weight to the comments that
94
- come earlier in sequence. The comment should similar to how the comments are given. Keep the story randomly between 50-120 words.
95
- Don't mention the comments or emotions. just return the story"""},
96
  {"role": "assistant", "content": """
97
- toss a coin if head comes, then make the story a bit humorous
98
- if tail comes then make the story a little bit sad and nostalgic. Just tell the story and nothing else.
99
- """}]
 
100
  ,temperature=temperature)
101
  return completion.choices[0].message.content
102
 
 
85
  completion = client.chat.completions.create(
86
  model="gpt-4o",
87
  messages=[{"role": "system", "content": f"""
88
+
89
+ Read all the comments, understand the emotions people are feeling and pick any random emotion
90
+ and create a story in first person based on that emotion picking a random character keep the words
 
 
91
  simple and a bit profound but overall simple words. Give more weight to the comments that
92
+ come earlier in sequence. The comments are given here: {comments_text}"""},
 
93
  {"role": "assistant", "content": """
94
+ ignore the comment which has lyrics of the song,
95
+ ignore all comments similar to 'anyone in 2024', Keep the story randomly between 50-120 words.
96
+ dont mention the emtion chosen just start the story.
97
+ sometimes include bits where you tell how this song makes you feel. half the times end the story with a hopeful future or a dark end or humorous."""}]
98
  ,temperature=temperature)
99
  return completion.choices[0].message.content
100