Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
John6666
/
ToyWorld4
like
4
Running
App
Files
Files
Community
b5b7eec
ToyWorld4
/
prompt_extend.py
John6666
Upload 8 files
84a5684
verified
5 months ago
raw
Copy download link
history
blame
Safe
210 Bytes
from
transformers
import
pipeline
pipe = pipeline(
'text-generation'
, model=
'daspartho/prompt-extend'
)
def
extend_prompt
(
prompt
):
return
pipe(prompt+
','
, num_return_sequences=
1
)[
0
][
"generated_text"
]