Spaces:
Runtime error
Runtime error
RamAnanth1
commited on
Commit
•
52d9e34
1
Parent(s):
381e026
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,14 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.queue(max_size=10,concurrency_count=20)
|
8 |
demo.launch(enable_queue=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
pipe = pipeline('text-generation', model='daspartho/prompt-extend')
|
|
|
5 |
|
6 |
+
def extend_prompt(input):
|
7 |
+
return pipe(prompt+',', num_return_sequences=1)[0]["generated_text"]
|
8 |
+
|
9 |
+
input_prompt = gr.Text(label="Enter the initial prompt")
|
10 |
+
sd2_output = gr.Text(label="Extended prompt suitable for Stable Diffusion 2")
|
11 |
+
|
12 |
+
demo = gr.Interface(fn=extend_prompt, inputs=input_prompt, outputs=sd2_output)
|
13 |
demo.queue(max_size=10,concurrency_count=20)
|
14 |
demo.launch(enable_queue=True)
|