Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from transformers import pipeline
|
|
5 |
|
6 |
def blog_gen(txt):
|
7 |
generator=pipeline(task='text-generation',model='gpt2')
|
8 |
-
gen_blog=generator(txt,max_length=
|
9 |
remove_gen_text = list(map(lambda x: x["generated_text"], gen_blog))
|
10 |
clean_text = list(map(lambda x: x.replace("\n\n", " "), remove_gen_text))
|
11 |
return clean_text
|
|
|
5 |
|
6 |
def blog_gen(txt):
|
7 |
generator=pipeline(task='text-generation',model='gpt2')
|
8 |
+
gen_blog=generator(txt,max_length=300,num_return_sequences=1)
|
9 |
remove_gen_text = list(map(lambda x: x["generated_text"], gen_blog))
|
10 |
clean_text = list(map(lambda x: x.replace("\n\n", " "), remove_gen_text))
|
11 |
return clean_text
|