Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 15 |
-
|
|
|
|
| 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 |
|