omair14 commited on
Commit
7b543b7
·
verified ·
1 Parent(s): 80d20fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,8 +11,9 @@ except Exception as e:
11
  def generate_blog_post(topic):
12
  try:
13
  # Generate a blog post based on the given topic
14
- response = generator(f"Write a blog post about {topic}", max_length=500, num_return_sequences=1)
15
- return response[0]['generated_text']
 
16
  except Exception as e:
17
  return f"Error generating blog post: {e}"
18
 
 
11
  def generate_blog_post(topic):
12
  try:
13
  # Generate a blog post based on the given topic
14
+ command = f"Write a blog post about {topic}: "
15
+ response = generator(command, max_length=500, num_return_sequences=1)
16
+ return response[0]['generated_text'][len(command):]
17
  except Exception as e:
18
  return f"Error generating blog post: {e}"
19