WiNE-iNEFF commited on
Commit
00230b5
1 Parent(s): 90321c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -21,13 +21,13 @@ def promptgen(choice, num, artist):
21
  generated = []
22
  artists_num = 0
23
  while len(sorted(set(generated), key=lambda d: generated.index(d))) < num:
24
- rand = random.randint(0, vocab)
25
- if prompt[rand-1].startswith('art by') and artists_num < artist:
26
  artists_num +=1
27
- generated.append(prompt[rand-1])
28
- elif not prompt[rand-1].startswith('art by'):
29
- generated.append(prompt[rand-1])
30
- print(', '.join(set(generated)) + '\n')
31
  return ', '.join(set(generated))
32
 
33
  demo = gr.Blocks()
@@ -38,7 +38,7 @@ with demo:
38
  <div style="text-align: center; margin: 0 auto;">
39
  <div style="display: inline-flex;align-items: center;gap: 0.8rem;font-size: 1.75rem;">
40
  <h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
41
- Simple Prompt Generator v0.4 (Gradio Demo)
42
  </h1>
43
  </div>
44
  <p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
 
21
  generated = []
22
  artists_num = 0
23
  while len(sorted(set(generated), key=lambda d: generated.index(d))) < num:
24
+ rand = random.choice(prompt)
25
+ if rand.startswith('art by') and artists_num < artist:
26
  artists_num +=1
27
+ generated.append(rand)
28
+ elif not rand.startswith('art by'):
29
+ generated.append(rand)
30
+ print(', '.join(set(generated)) + '\n\n')
31
  return ', '.join(set(generated))
32
 
33
  demo = gr.Blocks()
 
38
  <div style="text-align: center; margin: 0 auto;">
39
  <div style="display: inline-flex;align-items: center;gap: 0.8rem;font-size: 1.75rem;">
40
  <h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
41
+ Simple Prompt Generator v0.6 (Gradio Demo)
42
  </h1>
43
  </div>
44
  <p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">