DrishtiSharma commited on
Commit
fbe3161
Β·
verified Β·
1 Parent(s): 0763bc2

Update post_generator.py

Browse files
Files changed (1) hide show
  1. post_generator.py +6 -6
post_generator.py CHANGED
@@ -25,11 +25,11 @@ def generate_closing_line(language, tag, tone):
25
  - Use the language: "{language}" (Hinglish means Hindi phrases written in English script).
26
  Examples:
27
  - Topic: "Job Search", Tone: "Motivational", Language: "English"
28
- Closing Line: "Your dream job is closer than you think. Stay determined! πŸš€"
29
  - Topic: "Mental Health", Tone: "Professional", Language: "English"
30
- Closing Line: "Your mental well-being is essential. Let’s discuss ways to manage stress. πŸ’‘"
31
  - Topic: "Dating", Tone: "Informal", Language: "Hinglish"
32
- Closing Line: "Apka perfect date idea kya hai? Neeche share karein! πŸ˜„"
33
  Now, write a relevant closing line for the following inputs:
34
  Topic: "{tag}"
35
  Tone: "{tone}"
@@ -51,12 +51,12 @@ def generate_post(length, language, tag, selected_tone=None):
51
  if selected_tone and tag:
52
  try:
53
  closing_line = generate_closing_line(language, tag, selected_tone)
54
- post_content += f"\n\n\n{closing_line}"
55
  except Exception as e:
56
  # Fallback in case of LLM failure
57
  post_content += f"\n\nThank you for reading. Your feedback is valued! πŸ™Œ"
58
 
59
- return post_content
60
 
61
 
62
  def get_prompt(length, language, tag):
@@ -82,4 +82,4 @@ def get_prompt(length, language, tag):
82
 
83
 
84
  if __name__ == "__main__":
85
- print(generate_post("Medium", "English", "Mental Health"))
 
25
  - Use the language: "{language}" (Hinglish means Hindi phrases written in English script).
26
  Examples:
27
  - Topic: "Job Search", Tone: "Motivational", Language: "English"
28
+ Closing Line: "Your dream job is closer than you think. Stay determined! πŸš€ #DreamJob #StayMotivated"
29
  - Topic: "Mental Health", Tone: "Professional", Language: "English"
30
+ Closing Line: "Your mental well-being is essential. Let’s discuss ways to manage stress. πŸ’‘ #MentalHealth #StressManagement"
31
  - Topic: "Dating", Tone: "Informal", Language: "Hinglish"
32
+ Closing Line: "Apka perfect date idea kya hai? Neeche share karein! πŸ˜„ #DatingTips #FunDates"
33
  Now, write a relevant closing line for the following inputs:
34
  Topic: "{tag}"
35
  Tone: "{tone}"
 
51
  if selected_tone and tag:
52
  try:
53
  closing_line = generate_closing_line(language, tag, selected_tone)
54
+ post_content += f"\n\n{closing_line}" # Append the closing line with hashtags
55
  except Exception as e:
56
  # Fallback in case of LLM failure
57
  post_content += f"\n\nThank you for reading. Your feedback is valued! πŸ™Œ"
58
 
59
+ return post_content # Ensure the returned content has hashtags only from the LLM
60
 
61
 
62
  def get_prompt(length, language, tag):
 
82
 
83
 
84
  if __name__ == "__main__":
85
+ print(generate_post("Medium", "English", "Mental Health"))