app.py
CHANGED
@@ -8,8 +8,7 @@ examples = [["the roads are lovely dark and deep"], ["to be or not to be is the
|
|
8 |
|
9 |
|
10 |
def poem_generate(word):
|
11 |
-
prompt = """
|
12 |
-
word: risk
|
13 |
poem using word: And then the day came,
|
14 |
when the risk
|
15 |
to remain tight
|
@@ -32,12 +31,13 @@ def poem_generate(word):
|
|
32 |
}}
|
33 |
response = requests.post(API_URL, json=json_)
|
34 |
output = response.json()
|
35 |
-
poem = output[0]['generated_text'].split("\n\n")[0] +"."
|
|
|
36 |
return poem
|
37 |
|
38 |
def poem_to_image(poem):
|
39 |
print(poem)
|
40 |
-
poem = " ".join(poem
|
41 |
poem = poem + " oil on canvas."
|
42 |
steps, width, height, images, diversity = '50','256','256','1',15
|
43 |
img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(poem, steps, width, height, images, diversity)[0]
|
|
|
8 |
|
9 |
|
10 |
def poem_generate(word):
|
11 |
+
prompt = """word: risk
|
|
|
12 |
poem using word: And then the day came,
|
13 |
when the risk
|
14 |
to remain tight
|
|
|
31 |
}}
|
32 |
response = requests.post(API_URL, json=json_)
|
33 |
output = response.json()
|
34 |
+
poem = output[0]['generated_text'].split("\n\n")[0] # +"."
|
35 |
+
|
36 |
return poem
|
37 |
|
38 |
def poem_to_image(poem):
|
39 |
print(poem)
|
40 |
+
poem = " ".join(poem.split('\n'))
|
41 |
poem = poem + " oil on canvas."
|
42 |
steps, width, height, images, diversity = '50','256','256','1',15
|
43 |
img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(poem, steps, width, height, images, diversity)[0]
|