Kumarkishalaya commited on
Commit
57e1cdb
·
verified ·
1 Parent(s): 8578962

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -85,15 +85,17 @@ def generate_story(comments, temperature=0.7):
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 the third most common emotion
90
  and create a story in first person (the person can be randomly young or old and the story can be
91
  based in past or future) based on that emotion picking a random character keep the words
92
  simple and a bit profound but overall simple words. Give more weight to the comments that
93
- come earlier in sequence. The comments are given here: {comments_text}. The comment should similar to how the comments are given"""},
 
94
  {"role": "assistant", "content": """
95
- ignore the comment which has lyrics of the song,
96
- ignore all comments similar to 'anyone in 2024', Keep the story randomly between 50-120 words.
97
  """}]
98
  ,temperature=temperature)
99
  return completion.choices[0].message.content
 
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
99
  """}]
100
  ,temperature=temperature)
101
  return completion.choices[0].message.content