Spaces:
Sleeping
Sleeping
hugfaceguy0001
commited on
Commit
β’
4c8b1bb
1
Parent(s):
08fee89
update app.py to fix default poem
Browse files
app.py
CHANGED
@@ -4,14 +4,14 @@ import random
|
|
4 |
|
5 |
dataset = load_dataset("hugfaceguy0001/TangshiDalle3Images")['train']
|
6 |
demo = gr.Blocks(theme=gr.themes.Default(text_size="lg"))
|
7 |
-
N =
|
8 |
j = 3 * N + 1
|
9 |
poem_text = dataset[j]['prompt']
|
10 |
poem_info = dataset[j+1]['prompt']
|
11 |
poem_title = poem_info[poem_info.index("γ")+1:poem_info.index("γ")]
|
12 |
poem_author = poem_info[3:poem_info.index("η")]
|
13 |
poem = f" {poem_title} {poem_author}\n{poem_text}"
|
14 |
-
k = j
|
15 |
poem_image = dataset[k]['image']
|
16 |
def random_poem():
|
17 |
global N
|
|
|
4 |
|
5 |
dataset = load_dataset("hugfaceguy0001/TangshiDalle3Images")['train']
|
6 |
demo = gr.Blocks(theme=gr.themes.Default(text_size="lg"))
|
7 |
+
N = 149
|
8 |
j = 3 * N + 1
|
9 |
poem_text = dataset[j]['prompt']
|
10 |
poem_info = dataset[j+1]['prompt']
|
11 |
poem_title = poem_info[poem_info.index("γ")+1:poem_info.index("γ")]
|
12 |
poem_author = poem_info[3:poem_info.index("η")]
|
13 |
poem = f" {poem_title} {poem_author}\n{poem_text}"
|
14 |
+
k = j - 1
|
15 |
poem_image = dataset[k]['image']
|
16 |
def random_poem():
|
17 |
global N
|