Spaces:
Running
Running
Create prompt_extend.py
Browse files- prompt_extend.py +7 -0
prompt_extend.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
pipe = pipeline('text-generation', model='spaces/phenomenon1981/MagicPrompt-Stable-Diffusion')
|
4 |
+
|
5 |
+
def extend_prompt(prompt):
|
6 |
+
return pipe(prompt+',', num_return_sequences=1)[0]["generated_text"]
|
7 |
+
|