Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,13 @@ import random
|
|
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 |
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")
|