doevent commited on
Commit
34cfb12
1 Parent(s): 4188a3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,12 +4,13 @@ import random
4
 
5
 
6
  gpt2_pipe = pipeline('text-generation', model='succinctly/text2image-prompt-generator')
7
- set_seed(42)
8
 
9
  def generate(starting_text):
10
  seed = random.randint(1, 10000000)
 
11
  response= gpt2_pipe(starting_text, max_length=20, num_return_sequences=5)
12
- return response
13
 
14
  txt=grad.Textbox(lines=1, label="English", placeholder="English Text here")
15
  out=grad.Textbox(lines=1, label="Generated Text")
 
4
 
5
 
6
  gpt2_pipe = pipeline('text-generation', model='succinctly/text2image-prompt-generator')
7
+
8
 
9
  def generate(starting_text):
10
  seed = random.randint(1, 10000000)
11
+ set_seed(seed)
12
  response= gpt2_pipe(starting_text, max_length=20, num_return_sequences=5)
13
+ return response[1]
14
 
15
  txt=grad.Textbox(lines=1, label="English", placeholder="English Text here")
16
  out=grad.Textbox(lines=1, label="Generated Text")